SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict ArunB's Avatar
    Join Date
    Jun 2008
    Location
    Hyderabad
    Posts
    252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mcrypt encryption using Rijndael 128

    Can I use 1024 bit key as the encryption key for the Rijndael 128 or 256?

    I am trying
    PHP Code:
    mcrypt_encryptMCRYPT_RIJNDAEL_256, <<1024 bits RSA Keygenerated using OpenSSL>>, <<Data to encrypt>>, MCRYPT_MODE_ECB$strIV ); 
    and getting the error:

    Code:
    Warning: mcrypt_encrypt(): Size of key is too large for this algorithm in /ArunB/Desktop/CertEnc.php on line 50
    I am generating the 1024 bits Key using the open ssl command
    Code:
    openssl genrsa -out ArunB.key 1024
    What is the max. key size that I can use for this RIJNDAEL_256 algorithm?

    PHP v5.2.8

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    256 is the max key size for AES (Rijndael) 256.
    http://en.wikipedia.org/wiki/Key_size
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Addict ArunB's Avatar
    Join Date
    Jun 2008
    Location
    Hyderabad
    Posts
    252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any OpenSSL function to generate this 256bit key?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •