none
Encryption 1 in - 1 out type? RRS feed

  • Question

  • Hi,

    I need to encrypt some text where space is at a premium and was wondering what the best .NET encryption type is? It looks like ciphermode CTS would do it but it seems there is no support for it as yet in .NET?

    I need it to work in a way that if I put in 20 characters I would get 20 characters out or as near as I can get, does anyone know of a good encryption method in .NET that supports this method where space is at a premium?

    Thanks in advance
    Mike.
    Monday, April 14, 2008 9:53 AM

Answers

  • An encryption algorithm which will give you the same length output as input is a algo based on a stream cipher.  Algorithms based on block ciphers will give you a length which is a multiple of your input length and the block size.  You can read more here.
    Monday, April 14, 2008 1:28 PM
  • I don't have any examples as .NET to my knowledge doesn't have any built in stream cipher encyption algorithms.  You can use a library such as RC4.NET which implements probably the most widely used steam cipher algorithm.  There is  a small example included in the download. 

    Tuesday, April 15, 2008 1:45 PM

All replies

  • An encryption algorithm which will give you the same length output as input is a algo based on a stream cipher.  Algorithms based on block ciphers will give you a length which is a multiple of your input length and the block size.  You can read more here.
    Monday, April 14, 2008 1:28 PM
  • Hi,

    Thanks for that, I don't suppose you have or know of a place with examples in c# or vb.net do you?

    Mike.
    Tuesday, April 15, 2008 7:43 AM
  • I don't have any examples as .NET to my knowledge doesn't have any built in stream cipher encyption algorithms.  You can use a library such as RC4.NET which implements probably the most widely used steam cipher algorithm.  There is  a small example included in the download. 

    Tuesday, April 15, 2008 1:45 PM
  • Hi,

    yeah I did see that but was unsure of the license on it for putting into an application we will be selling on so I urged on the side of caution and left it alone, never been that good at reading long license files !
    Tuesday, April 15, 2008 2:16 PM