EDCrypt Online Help

Table Of Contents


 

Description

EDCrypt v3.1 is a cryptographic utility packaged as an ActiveX control.
The component performs following functions: Notes:
  1. Please be aware that many implementations of encryption algorithms exist on the market. While they all employ the same ideas they do not necessarily have to be binary compatible. Therefore, it may happen that data encrypted by EDCrypt will not be decrypted by other software or vice versa.
  2. Methods end events are not compatible with previous release (version 2.0). We hope that added functionality will make up for the trouble.
  3. EDCrypt was not designed or tested as a server-side component. It should be possible to make it work on ASP page, but we do not guarantee that.
  4. Please test the component extensively before paying for it! There are no time limits and demo version is not crippled in any way (it only displays a modest nag screen).
EDCrypt is a stand-alone component. It does not require any other files to work. The control can be distributed royalty-free in an unlimited number of applications.
 
EDCrypt is based on code developed by David Barton and Alex Demchenko.
 

Installation

EDCrypt is distributed as either a self-extracting archive or a zip file.
If you downloaded the self-extracting version the control is copied to system folder and registered automatically during setup. There is nothing more for you to do and you can start using the component or run included sample projects at once.
If you downloaded the zipped version please follow these steps:

License Agreement

Before using EDCrypt control please read carefully terms and conditions of this agreement. By using this software you are consenting to be bound by and are becoming a party to this agreement. If you do not agree to all terms of this agreement do not use the software and destroy all copies of the software from your computer.
  1. Softuarium (the company) grants you (the customer) a worldwide, non-exclusive, personal license to install, use and distribute the accompanying software royalty free in the manner provided herein.
  2. The customer agrees to perform any and all necessary tests to ensure the suitability and performance of the software before purchase and before relying on it in terms of functionality, stability, or performance. The company makes no representations or warranties about the suitability of this software for any purpose. The software is provided 'as is' without express or implied warranties, including warranties of merchantability and fitness for a particular purpose or non-infringement. The company may not issue updates to this software. This software is not fault-tolerant. It is not designed, manufactured or intended for use in hazardous environments requiring fail-safe performance. The company and its suppliers specifically disclaim any express or implied warranty of fitness for high-risk activities.
  3. The company or its suppliers shall not be liable for direct, incidental, consequential, special or indirect damages of any sort whatsoever. This includes loss of business profits, revenues, information, or business interruption resulting from customer's use of the software or inability to use the software, even if the company has been informed of the possibility of such damages. The customer agrees to indemnify, hold harmless, and defend the company from and against any claims or lawsuits, including attorney's fees, that arise or result from the use or distribution of the software.
  4. The software is licensed, not sold. The software is protected by copyright law, international copyright treaty provisions and other intellectual property laws and treaties. Title, ownership rights, and intellectual property rights in and to the software shall remain with the company. Customer agrees not to modify the software or attempt to decipher, decompile, disassemble or reverse engineer the software.
  5. The software is licensed for concurrent use on limited number of development computers, depending on type of license purchased. Customer may delete the software from one development computer and reinstall it on another, but customer may not install the software on more development computers than the license allows for.
  6. Registered version of the software may not be used in open source applications. The registration code used to unlock the software may not be distributed under any circumstances.
  7. The customer may not resell, rent, lease, distribute nor in any other manner commercially exploit the software alone. The software must be distributed as a part of, and in connection with an application or with application's installation files. The customer is not permitted to use the software to create development tools, components or controls (such as DLL, ActiveX, VCL, etc.) intended for distribution to other software developers or programmers.
  8. The company may terminate this license at any time by delivering notice to customer and customer may terminate this license at any time by destroying or erasing customer's copy of the software. Upon termination of this license, customer agrees to destroy all copies of the software. In case of termination sections 2, 3, 4, 6, 7 and 8 of this agreement shall indefinitely survive its termination. This license is the complete statement of the agreement between the company and customer and merges and supersedes all other or prior understandings, purchase orders, agreements and arrangements.

Ordering And Registration

Evaluation version of EDCrypt is fully functional, but it displays a nag message. When you register this message is suppressed.
 
To unlock your copy of EDCrypt you need to buy registration code.
 
After placing order you will receive registration code in e-mail. To unlock demo version of EDCrypt you need to add one line of code to your application: a call to Unlock method with your registration code as parameter.
 

DecryptFileToFile

DecryptFileToFile (infile: WideString; algorithm: TEncryptionAlgorithm; password: WideString; outfile: WideString);

This method decrypts previously encrypted file. During decryption the DecryptFileProgress event is periodically fired. Takes following parameters:

DecryptTextToFile

DecryptTextToFile (text: WideString; algorithm: TEncryptionAlgorithm; password: WideString; filename: WideString);

This method decrypts previously encrypted text and saves result to file. It takes following arguments:

DecryptTextToText

DecryptTextToText (text: WideString; algorithm: TEncryptionAlgorithm; password: WideString): WideString;

This method decrypts previously encrypted text. Please note that this method is a function, i.e. it returns a value, namely the decrypted text. The method takes following parameters:

EncryptFileToFile

EncryptFileToFile (infile: WideString; algorithm: TEncryptionAlgorithm; password: WideString; outfile: WideString);

This method encrypts existing file. During encryption the EncryptFileProgress event is fired periodically. The method takes following parameters:

EncryptTextToFile

EncryptTextToFile (text: WideString; algorithm: TEncryptionAlgorithm; password: WideString; filename: WideString);

This method encrypts plain text and saves result to file. It takes following parameters:

EncryptTextToText

EncryptTextToText (text: WideString; algorithm: TEncryptionAlgorithm; password: WideString) : WideString;

This method encrypts plain text. Please note that this method is a function, i.e. it returns a value, namely the encrypted text. The method takes following parameters:

GetFileHash

GetFileHash (filename: WideString; algorithm: THashingAlgorithm): WideString;

This method computes message digest (hash string) of a file. Please note that this method is a function, i.e. it returns a value, namely the hash string. The method takes following parameters:

GetTextHash

GetTextHash (text: WideString; algorithm: THashingAlgorithm): WideString;

This method computes message digest (hash string) of text. Please note that this method is a function, i.e. it returns a value, namely the hash string. The method takes following parameters:

ShredFile

ShredFile (filename: WideString; passes: Integer);

This method shreds (permanently overwrites and deletes) a file. During shredding the ShredFileProgress event is fired periodically. The method takes following parameters: Please use this method with caution, because once a file is shredded it cannot be recovered.
 

Unlock

Unlock (regcode: String): Boolean;

If you are a registered user call this method with your registration code to unlock demo version. Registration code is case sensitive. We recommend placing this call in OnFormCreate or OnFormLoad event handler (or equivalent specific to your development language) or immediately after instance of control is created dynamically.

Please be aware that you are not allowed to use registered version of EDCrypt in open source applications or disclose your registration code.

Tip: depending on you screen font it may be difficult to distinguish between numeral '1' and lower case 'L', numeral '0' and upper case 'O', and so on - if they happen to exist in your registration code. We recommend that you copy and paste registration code instead of entering it manually.

Note: 'Unlock' method returns boolean value indicating if call was successful or not. This value does not indicate if registration code is correct :-)
 

DecryptFileProgress

DecryptFileProgress (percent: Integer);

Event fired periodically during file decryption. File decryption progress is returned by the value of percent parameter.
 

EncryptFileProgress

EncryptFileProgress (percent: Integer);

Event fired periodically during file encryption. File encryption progress is returned by the value of percent parameter.
 

ShredFileProgress

ShredFileProgress (percent: Integer);

Event fired periodically during file shredding. File shredding progress is returned by the value of percent parameter.
 

Function Signature Syntax

Method and event signatures in this help file are specified using Pascal syntax. For example, a method may be described as:
    MethodName (ParameterName: ParameterType): MethodType;
If you use Visual Basic this is equivalent to:
    MethodName (ParameterName As ParameterType) As MethodType
If you use C++ or C# this means:
    MethodType MethodName (ParameterType ParameterName);

Custom Data Types

EDCrypt uses following enumerations:
    TEncryptionAlgorithm = (eaBLOWFISH,
                            eaCAST128,
                            eaGOST,
                            eaRC2,
                            eaRIJNDAEL,
                            eaTWOFISH);
                            
    THashingAlgorithm    = (haADLER32,
                            haCRC32,
                            haCRC32B,
                            haGOST,
                            haHAVAL128,
                            haHAVAL160,
                            haHAVAL192,
                            haHAVAL224,
                            haHAVAL256,
                            haMD2,
                            haMD4,
                            haMD5,
                            haRIPEMD128,
                            haRIPEMD160,
                            haSHA1,
                            haSHA256,
                            haSHA384,
                            haSHA512);

Passwords

Call to each method encrypting / decrypting data requires a password. Different encryption algorithms accept different password lengths:
encryption algorithm        password length (characters)

    eaBLOWFISH                        1 - 56
    eaCAST128                         1 - 16
    eaGOST                            1 - 32
    eaRC2                             1 - 128
    eaRIJNDAEL                        1 - 32
    eaTWOFISH                         1 - 32

File vs Text Encryption / Decryption

Please note that text encryption / decryption works differently than file encryption / decryption.
 
When encrypting text data the following operations are taking place:
    input (clear text) -> intermediate stage (encrypted text) -> output (Base64 encoded encrypted text)
When decrypting text data the operations are reversed:
    input (cipher text) -> intermediate stage (Base64 decoded cipher text) -> output (decrypted text)
Encrypting file data is simpler:
    input (original file data) -> output (encrypted file data)
and so is decrypting:
    input (encrypted file data) -> output (decrypted file data)
Base64 encoding is introduced to ensure that encrypted text contains only printable characters. Otherwise attempts to display encrypted text in controls such as labels, edit boxes, memos, etc could lead to unpredictable behaviour, because non-printable characters such as null are displayed inconsistently. When encrypting files such precautions are not necessary and intermediate Base64 encoding is not used.
While the above approach helps to avoid problems, it can also lead to a potentially confusing situation where encrypting text file using EncryptFileToFile method and then trying to decrypt it using DecryptTextToText method does not work even if the same encryption algorithm and password are used. This is because the control is trying to first Base64 decode data that was not Base64 encoded.
 
If you need such functionality in your application you should do the following:
  1. at encryption stage: encrypt text and save text data to file (instead of encrypting text file directly)
  2. at decryption stage: read file data into text variable and decrypt it