Re: TripleDES output size



On 5 Oct 2006 23:28:53 -0700, "Valery Pryamikov" <valery@xxxxxxxxx>
wrote:

Thanks for your reply but it doesn't help me.

I mean. Let's say I've a 5 chars string I want to encrypt.
Encrypting it using .NET framewirk TripleDESCryptoServiceProvider
gives me a string of 24 chars lenght.
Now how can I calculate the length of the crypted string based on the
size of the plain one?

Thanks.

HI,
3DES has 8 bytes (64 bits) block size.
if you use it with default CBC mode of encryption, the last block is
always padded to make it a full block. In case if plain text size is
exact multiple of 8 bytes, then the whole block of padding is added.

-Valery.
http://www.harper.no/valery

Arturo Buonanni wrote:
Hello to all,

I'm new to cryptography and I've to implement encryption of data into
a database.
I'm using .NET framework TripleDESCryptoServiceProvider to crypt and
decrypt strings.
Anyway I can not find any reference on how to calculate the length of
the encrypted string based on the length of the plain string.
As I've to store the encrypted data into table fields, I've to be sure
it fits into the field size.

Does anybody knows how to do this?

Thanks.
(I'm posting this also to microsoft.public.security.crypto)
.



Relevant Pages

  • Re: Byte array to string and back - newbie question
    ... // Create a symmetric algorithm. ... This is done to make encryption more ... // Encrypt a string into a string using a password ... // Decrypt a byte array into a byte array using a key and an IV ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Using Python To Create An Encrypted Container
    ... an encrypted archive utility designed for secure archiving ... A match string allows you to only extract files matching a given ... Encrypt the string s using passwd and encryption cipher enc ...
    (comp.lang.python)
  • Re: How good an encryption algorithm is this?
    ... As long as the string can be converted to/from a byte stream, ... then you can apply that after the encryption. ... > So I decided to invent my own algorithm, and I just wanted anybody's> opinion on how secure this could be compared to the Win32 API version. ... > HCRYPTHASH hCryptHash; ...
    (microsoft.public.vc.language)
  • Length of the data to decrypt is invalid
    ... I found this code on a site for doing string encryption/decryption. ... // Create a symmetric algorithm. ... // This is done to make encryption more secure. ... // This will tell it that we have done our decryption ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web app security
    ... public static string EncryptToBase64String(string stringToEncrypt, ... we'd also like to move on to better encryption such ... to make the.NET AES encryption to work together with the AES encryption ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet)