Since the advent of ASP (Active Server Pages), due to its ability to create healthy and easy maintenance, the ASP technology has received more and more network programmers, and the use of ASP is increasingly involved in Web development. many. However, ASP is just a non-compilation, the scripting language running in the server, using the plain text) method, even if the ASP encryption is encrypted, it is not necessarily guaranteed to the operation environment The ASP application is not illegally copied. For administrators of high-level, you can easily copy the ASP program to other unauthorized websites from the server side. This brings certain difficulties to ASP app commercialization. How to effectively protect the developed ASP program, this article is based on the randomness generated by the disk serial number, combined with the Microsoft's official free ASP script encryption program Screnc.exe, which is well solved this problem.
Disk serial number, referred to as disk ID, is a disc identification information generated randomly generated when it is formatted, is a volume sequence number. The same machine is formatted twice. The same chance is almost zero. The late version of DOS is almost zero. The later version and Windows, WinNT use this disk identification mode, so the disk serial number is often used for commercial software to encrypt. use. Switch from Windows9.x to the MS-DOS mode, type the Dir command and enter, the current volume sequence number information appears in the screen, the serial number similar to "0A48-1CD7" is a 16-based number. Some software used within a limited time, after use, will require the user to apply for a new authorization serial number online (license). This kind of authorization serial number is considerably generated by a static disk serial number combining time. After installation, the program cannot be used even if it is illegally copied into an in-place installation environment.
The above ideas are easy to implement in VC, VB, and Deliphi programming languages, then how do you implement in ASP? VBScript As a robust, secure user language, is limited by the client system, cannot handle the call of the API on the client, and cannot directly manipulate the controls other than the files outside the client. Therefore, this paper uses VBScript and combined with the ASP built-in component FileSystem to achieve the above ideas. The following procedures can be applied to the actual ASP application system based on the specific situation.
As an example of explanation, this article uses the Access database security mechanism, in practical applications, you can store data in other formats. For the convenience, we first build an Access database id.mdb (password "kxj"), build a DriveInfo table, the data structure is as follows:
ID (Auto Number); Serno (Text, 12, Disk Serial Number (10)); Wrimark (Number, 1, Wrike Sign,).
Description
The WRIMARK value is 0 represents the legal user is not installed, the value is 1 means that the system is installed. When the value is 1 and the serial number does not match the current disk, it is determined as illegal copying users.
When initialization, first define a new record, each field initial value is 1,12345678,0, respectively.
Under the same directory, such as C: / Interpub / wwwroot, place the home page default.asp, legal user home Success.asp, illegally install User Tips page fail.htm and id.mdb serial number storage library.
The writing operations of each ASP file are as follows:
1. Use FrontPage (or NOTEPAD), create a new ASP file default.asp, enter the following program code:
S asp Document.you Are Not Rigrt To Use The Program.
") end ifendiffiffness.write ("<% IF session ("pass") = false then 'determines the session variable, illegally jumps out of this ASP file Response.Redirect ("fail.htm") end if%>
3. Use ASP encryption programs (such as Microsoft's Screnc.exe, other ASP encryption programs) to encrypt each ASP file.
Running Screnc -l Vbscript Source.asp Destination.asp in DOS, that is, the source file source.asp generates new file Destination.asp containing Cipheet ASP scripts. Screnc.exe can download free in Microsoft Site (http://www.microsoft.com). The above program code is passed under Simplified Chinese NT4.0, IIS3.0 and Simplified Chinese PWIN9.8, PWS4.0.