Shop OBEX P1 Docs P2 Docs Learn Events
Someone please straighten me out about 128 bits versus 256 bits etc.... — Parallax Forums

Someone please straighten me out about 128 bits versus 256 bits etc....

Don MDon M Posts: 1,652
edited 2014-03-16 13:05 in Propeller 1
On my Mac I request an AES 128 bit key and this is what I get:

Mac-mini:~ Don$ openssl enc -aes-128-ecb -k secret -P -md sha1

salt=CB4965AB825F439A
key=4CE5696CBAA93AB93945829B4322BE78

It looks to me that the key is 256 bits (32 HEX bytes) long if I'm looking at it this way 16 bytes * 8 bits == 256 bits:

4C E5 69 6C BA A9 3A B9 39 45 82 9B 43 22 BE 78


Do I only use half of it for a 128 bit key?

Also what does "salt" mean?

Comments

  • SRLMSRLM Posts: 5,045
    edited 2014-03-16 12:20
    Don M wrote: »
    It looks to me that the key is 256 bits (32 HEX bytes) long if I'm looking at it this way 16 bytes * 8 bits == 256 bits:

    4C E5 69 6C BA A9 3A B9 39 45 82 9B 43 22 BE 78

    A hex digit is 4 bits, not 8... So, 16 bytes * 8 bits == 256 bits 128 bits
  • D.PD.P Posts: 790
    edited 2014-03-16 12:25
    SRLM wrote: »
    A hex digit is 4 bits, not 8... So, 16 bytes * 8 bits == 256 bits 128 bits

    And from the ssl manual:

    "Note the -salt option. The salt is a set of random characters that OpenSSL combines with the password to create the encryption and authentication keys. This makes dictionary and brute force attacks considerably more difficult. Always use the -salt option. "
  • r.daneelr.daneel Posts: 96
    edited 2014-03-16 12:25
    Each hex digit is 4 bits. You have 32 hex digits, so that'd be 32 * 4 = 128. Not sure where you're getting 256. 16 * 8 = 128, not 256.

    Read about Salt here:

    http://en.wikipedia.org/wiki/Salt_(cryptography)
  • Don MDon M Posts: 1,652
    edited 2014-03-16 13:05
    Thanks everyone for straightening me out here... I was confusing a byte with a digit.
Sign In or Register to comment.