mrwad99
asked on
Encrypt and decrypt a CString
Ah hello.
I am looking for an algorithm that can encrypt and decrypt a CString. The thing is, this CString may be as simple as a "1" or "0", so I am looking for something that will obviously increase the length of it if necessary.
Can someone link or list suitable code please ? I have looked around via Google and not come up with anything suitable.
TIA
I am looking for an algorithm that can encrypt and decrypt a CString. The thing is, this CString may be as simple as a "1" or "0", so I am looking for something that will obviously increase the length of it if necessary.
Can someone link or list suitable code please ? I have looked around via Google and not come up with anything suitable.
TIA
You need a symetrical block cipher, like IDEA or 3DES by example, minimum result is a 64 bytes block even for a 1 char string, also you can pad "random garbage" to the string to complete 8 bytes (64 bits) to avoid to be hacked with repetitive short messages like "1" or "0".
ASKER
Right, so where can I find example code ?
Here you have DES/3DES theory:
http://kingkong.me.berkeley.edu/~kenneth/courses/sims250/des.html
Here some source code of DES (I suggest to use DES instead of 3DES because it is simpler and faster, unless you have a critical requirement):
http://www.ussrback.com/crypto/cracking-des/cracking-des/ch5/des.c
http://kingkong.me.berkeley.edu/~kenneth/courses/sims250/des.html
Here some source code of DES (I suggest to use DES instead of 3DES because it is simpler and faster, unless you have a critical requirement):
http://www.ussrback.com/crypto/cracking-des/cracking-des/ch5/des.c
ASKER
Thanks.
OK cool, will read that shortly. In the meantime, if anyone has any other code suggestions, please post.
OK cool, will read that shortly. In the meantime, if anyone has any other code suggestions, please post.
ASKER
preferably something simple...:-)
don't have to understand so much, just copy/paste and adapt
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all :)