0

I am looking for a Stream Cipher encryption method, that will result in the encrypted string being prefferably as short as possible, and containing alphanumeric characters only. Is there such a thing built in .NET? I have researched but could not find something like this.

Thank you,

Amc_rtty
  • 3,662
  • 11
  • 48
  • 73
  • I found the answer here http://stackoverflow.com/questions/1192732/really-simple-short-string-compression , meaning its not possible, as encryption means also making the value longer. The best that can be done is keeping the same size of the input, but if the result must be alphanumeric then a longer string is a must. – Amc_rtty May 18 '12 at 16:52
  • Well, mathematically speaking, you *should* be able to use the exact same size of the input + max 1 bit. But it's tricky to get that performing all right, lots of division with big numbers. You could try to get something as much bit alligned as possible though, and then convert back. – Maarten Bodewes May 20 '12 at 01:44

2 Answers2

0

I found the answer here Really simple short string compression, meaning its not possible, as encryption means also making the value longer. The best that can be done is keeping the same size of the input, but if the result must be alphanumeric then a longer string is a must

Community
  • 1
  • 1
Amc_rtty
  • 3,662
  • 11
  • 48
  • 73
-3

You can make it shorter - just zip the resulting encrypted string using java or some other library and output as hex. Pretty straight forward.

Sean
  • 1