The topic says it all I need a crypt/decrypt function that works without control chars or null's.
Thanks in advance!
( it dosen't need to be the best but something good that works would be great. )
Printable View
The topic says it all I need a crypt/decrypt function that works without control chars or null's.
Thanks in advance!
( it dosen't need to be the best but something good that works would be great. )
Use a crypter which generates control chars and nulls, and then convert that string to ASCII85, see http://en.wikipedia.org/wiki/Ascii85 or to uuencode, see http://en.wikipedia.org/wiki/Uuencoding.
Or maybe it is not a problem if you have control chars and nulls. In the past, I thought it was a problem because I saved a crypted password in a VARCHAR or in a VARCHAR2 field. Then, I realized, I could use a CHAR field instead in my database and the good thing is that a CHAR field can contain control chars and nulls.
Use a cryptosystem that is regarded as secure by the experts, e.g., use AES. Satisfy your requirement for "non-controls chars or null's" by transforming the ciphertext into your desired format. Something like base 64 encoding could well suffice.
Do you know what ASCII85 is? An ASCII85 stream does not contain control characters or NULLs. If it did, it would defeat the purpose of it being ASCII85.
ASCII85, Base64, and others are no more than variations on the same theme -- each algorithm creates a stream that has no null or control characters. How each algorithm works is different, but the final result is a stream that has plain ASCII characters that doesn't contain control characters or NULLs.
Regards,
Paul McKenzie
All advanced cryptology works on large (incredibly large) numbers. So the text you encrypt is interpreted as a bunch of bytes forming a large number and likewise the encrypted message is a large number as well. While each large number can be interpreted as a series of bytes, transforming it into a readable/displayable form is not part of the encrypter. Other algorithms exist for that, starting from hexdump over base64 to ASCI85.
Just to be clear, are you looking for an encrypter, or an encoder?
Worst case scenario, you can encode with base64 the output of some random encryption scheme.
Since you haven't been to clear about your needs, the answer is a bit vague...
thanks all. it was a crypter. I managed with assci85
ASCII85 is an encoder, not a crypter. All ASCII85 does is to make sure that the stream doesn't contain control characters and NULLs.
It does this by using an algorithm based on multiples of 85:
See here:
http://en.wikipedia.org/wiki/Ascii85
So you didn't encrypt anything.
Regards,
Paul McKenzie