Reversible Cipher Question
-
Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...
-
Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...
Decrypt it. Convert it to upper case. Re-encrypt it. You cannot convert it to upper case while it is in its encrypted state.
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
-
Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...
do you mean convert the crypttext into something that looks like ABLKSJFHUIWKLDHALSDHQWE... or to capitalize the contents of the encrypted text while keeping it encrypted? The later as the other poster mentioned is impossible. The simplest way to do the former would be to map each 8 bit value onto one of the first 256 2 upper case character pairs. eg 0x00 = AA 0x01 = AB .. 0x1A = AZ 0x1B = BA ...
-- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
-
Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...
Although not strictly letters, maybe a simple hex representation is sufficient, i.e. replace each encrypted byte by two characters in [0-9A-Z]. byte.ToString("X2") would do that for you. And byte.Parse(string, NumberFormat.HexNumber) would undo it. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
do you mean convert the crypttext into something that looks like ABLKSJFHUIWKLDHALSDHQWE... or to capitalize the contents of the encrypted text while keeping it encrypted? The later as the other poster mentioned is impossible. The simplest way to do the former would be to map each 8 bit value onto one of the first 256 2 upper case character pairs. eg 0x00 = AA 0x01 = AB .. 0x1A = AZ 0x1B = BA ...
-- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
-
Although not strictly letters, maybe a simple hex representation is sufficient, i.e. replace each encrypted byte by two characters in [0-9A-Z]. byte.ToString("X2") would do that for you. And byte.Parse(string, NumberFormat.HexNumber) would undo it. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
If acceptable that'd be a better solution than mine, but I suspect the all uppercase letter requirement is due to interfacing with a crufty legacy system not new development that is potentially changeable.
-- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
-
dan neely wrote:
do you mean convert the crypttext into something that looks like ABLKSJFHUIWKLDHALSDHQWE...
Yes, and your suggestion should work fine for what I want to do... Thank you.
Or you could try UUEncoding, which isnt exactly what you have requested, but at least you wont be reinventing the wheel.
Mark Churchill Director Dunn & Churchill