Help with Encryption Library

Discussion in 'ASP .Net Security' started by Mike Carr, Apr 6, 2004.

  1. Mike Carr

    Mike Carr Guest

    I followed the Guide "How To: Create an Encryption Library" of Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication. I kept getting an error here:

    decStream.FlushFinalBlock() whenever the text to Decrypt was under 7 characters. Is there a minimum text length that TripleDes can Encrypt/Decrypt?
    public byte[] Decrypt(byte[] bytesData, byte[] bytesKey)
    {
    .... decStream.FlushFinalBlock(); <=== HERE...
    } //end Decrypt

    --
    MICHAEL CARR
     
    Mike Carr, Apr 6, 2004
    #1
    1. Advertising

  2. Michael,

    The minimum text lengh for decryption depends on the algorithm block size
    expressed in bytes in case you where using a block cipher algorithm like
    DES, 3DES, RC2 or Rijndael. If you take for example 3DES with a defualt
    blocksize of 64 bits (8 bytes), the minimum length will be 8 bytes. If your
    encrypted data size is less then 8 bytes, the encription process will apply
    padding to complete the 8 bytes (or a multiple of 8) size. So on every block
    ci[her your encrypted data size will always be a multiple of the blocksize
    algorithm.

    Cheers,
    Hernan
    --
    Hernan de Lahitte
    Lagash Systems S.A.
    http://weblogs.asp.net/hernandl
    Shadowfax Dev Team

    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Mike Carr" <> wrote in message
    news:...
    I followed the Guide "How To: Create an Encryption Library" of Building
    Secure ASP.NET Applications: Authentication, Authorization, and Secure
    Communication. I kept getting an error here:

    decStream.FlushFinalBlock() whenever the text to Decrypt was under 7
    characters. Is there a minimum text length that TripleDes can
    Encrypt/Decrypt?
    public byte[] Decrypt(byte[] bytesData, byte[] bytesKey)
    {
    ....
    decStream.FlushFinalBlock(); <=== HERE
    ....
    } //end Decrypt


    --
    MICHAEL CARR
     
    Hernan de Lahitte, Apr 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZG90bmV0dGVzdGVy?=

    help with encryption

    =?Utf-8?B?ZG90bmV0dGVzdGVy?=, Aug 12, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    329
    Brock Allen
    Aug 12, 2005
  2. drs

    encryption/decryption help

    drs, Jan 12, 2005, in forum: Python
    Replies:
    4
    Views:
    534
    Jorgen Grahn
    Jan 12, 2005
  3. Jules
    Replies:
    0
    Views:
    970
    Jules
    Jul 18, 2007
  4. Joe Van Dyk

    encryption library

    Joe Van Dyk, Aug 30, 2006, in forum: Ruby
    Replies:
    12
    Views:
    222
    Srinivas JONNALAGADDA
    Aug 31, 2006
  5. Sudo Nim
    Replies:
    1
    Views:
    132
    Bart Van der Donck
    Feb 19, 2008
Loading...

Share This Page