|
-
September 29th, 2010, 10:10 AM
#1
I need a crypter without control chars or nulls
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. )
-
September 29th, 2010, 10:19 AM
#2
Re: I need a crypter without control chars or nulls
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.
-
September 29th, 2010, 11:25 AM
#3
Re: I need a crypter without control chars or nulls
 Originally Posted by olivthill2
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.
it's not for a database that's why id rather not use ASCII85 and just have a crypter that uses only non-controls chars or null's
-
September 29th, 2010, 11:39 AM
#4
Re: I need a crypter without control chars or 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.
-
September 29th, 2010, 12:57 PM
#5
Re: I need a crypter without control chars or nulls
 Originally Posted by laserlight
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.
I have AES how do you set those informations ?!
I have a AES.lib and a aes.h os_1.h os_2.h openssconfg.h its already included in my project.
-
September 29th, 2010, 02:24 PM
#6
Re: I need a crypter without control chars or nulls
 Originally Posted by dsylebee
it's not for a database that's why id rather not use ASCII85 and just have a crypter that uses only non-controls chars or null's
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
-
September 29th, 2010, 02:29 PM
#7
Re: I need a crypter without control chars or nulls
 Originally Posted by dsylebee
I have AES how do you set those informations ?!
I have a AES.lib and a aes.h os_1.h os_2.h openssconfg.h its already included in my project.
So you don't know how to use the library that is responsible for encrypting the text? Maybe that is what you should first know how to do, and that is how to start doing basic encryption.
Does your library come with sample code?
Regards,
Paul McKenzie
-
September 30th, 2010, 08:04 AM
#8
Re: I need a crypter without control chars or nulls
 Originally Posted by dsylebee
[...] id rather not use ASCII85 and just have a crypter that uses only non-controls chars or null's
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.
More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity. --W.A.Wulf
Premature optimization is the root of all evil --Donald E. Knuth
Please read Information on posting before posting, especially the info on using [code] tags.
-
September 30th, 2010, 08:18 AM
#9
Re: I need a crypter without control chars or nulls
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...
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
-
October 4th, 2010, 07:26 AM
#10
Re: I need a crypter without control chars or nulls
thanks all. it was a crypter. I managed with assci85
-
October 4th, 2010, 07:42 AM
#11
Re: I need a crypter without control chars or nulls
 Originally Posted by dsylebee
thanks all. it was a crypter. I managed with assci85
That's a terrible crypter. Anybody can decode it.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
-
October 4th, 2010, 04:25 PM
#12
Re: I need a crypter without control chars or nulls
 Originally Posted by dsylebee
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|