|
www.astatech.com |
![]() |
![]() |
|
|||||||||||||||||||||
|
Encryption
ASTA provides great flexibility for encryption. In addition to giving you complete control over any encryption scheme that you may wish to implement, ASTA ships with built-in encryption that you can activate without writing a single line of code -- instant encryption! To enable the built-in encryption simply set the AstaClientSocket and the AstaServerSocket's Encrypt property to "etAstaEncrypt" and recompile (you must recompile the server and the client, otherwise they will be out-of-synch). The etAstaEncrypt algorithm is quite simple but it will discourage casual lurkers (keep in mind that most security breaches are the result of social engineering, not highly skilled hacking). For those developers that need to implement high-level security, we have provided OnEncrypt and OnDecrypt event handlers. Those event handlers allow the developer to plug in third-party or self-authored encryptions schemes. You have complete control over the encryption that you wish to use. To implement your own encryption routines, you must insert your encryption and decryption routines in the server and the client's OnEncrypt and OnDecrypt event handlers. ASTA passes the message into the event handlers as a String type. If your encryption library is string based you code would look like the following calls.
procedure TForm1.AstaServerSocket1Encrypt(Sender: TObject; var S: String); If, however, you have a streams based encryption library, you would need to take some extra steps. ASTA provides a couple of functions to help you manage String and Stream conversions. To use these functions, you must add AstaUtil to the unit's Uses clause. function NewStringToStream(S: AnsiString): TMemoryStream; The following code shows how you would use these calls to encrypt the message.
procedure TForm1.AstaServerSocket1Encrypt(Sender: TObject; var S: String); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Last modified: 5/5/2002 7:32:11 AM |
||
| Copyright © 2001-2002 |
|