CSimpleEncryption - A simple symmetric encryption algorithm If you want to keep some of your application’s data private and just want a simple symmetric encryption algorithm, then this is the class you have been waiting for...
This class is based on a two step algorithm: - The first step scrambles the input string by sorting all even and odd characters of the string. This makes it more difficult for ‘hackers’ to figure out the encryption algorithm. - The second step simply adds a predefined value (in this case the length of the string and character position) to each character in the string.
The class has the following methods:
CString EncryptString(LPCTSTR lpszText);
where lpszText is the string you want to encrypt. The return value is the encrypted string.
CString DecryptString(LPCTSTR lpszText);
where lpszText is the string you want to decrypt. The return value is the decrypted (original) string..
For a more complex (and better) type of encryption, check out my CEncryption class which uses the Microsoft CryptoAPI.
Download demo executable
Download source code This class is part of the Pablo Software Solutions MFC Extension Package - Classes Edition
|