Delphi Crypto Wrapper
Provides a wrapper to common calls to the Microsoft Crypto API as well as
other useful crypto related routines.
| Base64 Sample Code |
procedure Base64Sample;
var
Crypto: TwpsCrypto;
EncodedString: string;
DecodedString: string;
Value: string;
begin
Value := 'This is text to be encoded.';
Crypto := TwpsCrypto.Create;
try
// Encode value.
EncodedString := Crypto.EncodeToBase64String(Value);
// Decode encoded value.
DecodedString := Crypto.DecodeFromBase64String(EncodedString);
finally
Crypto.Free;
end;
end;
|
|
| Encrypt Decrypt Sample Code |
procedure EncryptDecryptValueSample;
const
ValueToEncrypt = 'http://www.whitepeaksoftware.com/';
SecretPhrase = 'White Peak Software';
var
EncryptedValue: string;
DecryptedValue: string;
Crypto: TwpsCrypto;
begin
Crypto := TwpsCrypto.Create;
try
EncryptedValue := Crypto.EncryptValue(ValueToEncrypt, SecretPhrase);
DecryptedValue := Crypto.DecryptValue(EncryptedValue, SecretPhrase);
finally
Crypto.Free;
end;
end;
|
|
Warranty
WPS Delphi Library
software is provided 'as-is', without
any express or implied warranty. In no event will the authors be held liable
for any damages arising from the use of this software.
License
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the certain restrictions (see individual source code
files for restrictions).