Questions tagged [aes]

Advanced Encryption Standard (AES) is a cryptographic block cipher algorithm.

The latest addition to the block cipher algorithms. DES was published in 1977 based on IBM's previous work on the Lucifer cipher with an expected life span of 10 years. As a result of DES's fame, it has been targeted and probed by cryptanalysis for any weaknesses. The price of fame came at a cost, as a result NIST launched a competition announcing a successor to DES which would be known as AES. Several proposals were submitted and the winner was announced on October 2, 2000.

The cipher uses a default 128-bit block size, with varying key sizes of 128, 192 and 256 bits. (AES deviated from the original Rijndael proposal)

The Rijndael cipher was developed by two Belgian cryptographers: Joan Daemen and Vincent Rijmen

7171 questions
71
votes
2 answers

Storing passwords with Node.js and MongoDB

I'm looking for some examples of how to securely store passwords and other sensitive data using node.js and mongodb. I want everything to use a unique salt that I will store along side the hash in the mongo document. For authentication do I have to…
fancy
  • 48,619
  • 62
  • 153
  • 231
70
votes
1 answer

Example of AES using Crypto++

I have been searching the Internet for good c++ AES code sample/tutorial that teaches the basics of the encryption technology and the use of the Library but so far I have had no luck getting decent material. good: Easy to understand (Just the basics…
yohannist
  • 4,166
  • 3
  • 35
  • 58
67
votes
10 answers

PHP AES encrypt / decrypt

I found an example for en/decoding strings in PHP. At first it looks very good but it wont work :-( Does anyone know what the problem is? $Pass = "Passwort"; $Clear = "Klartext"; $crypted = fnEncrypt($Clear, $Pass); echo "Encrypted:…
Andreas Prang
  • 2,187
  • 4
  • 22
  • 33
66
votes
6 answers

When compressing and encrypting, should I compress first, or encrypt first?

If I were to AES-encrypt a file, and then ZLIB-compress it, would the compression be less efficient than if I first compressed and then encrypted? In other words, should I compress first or encrypt first, or does it matter?
Sei Satzparad
  • 1,137
  • 1
  • 9
  • 12
64
votes
6 answers

InvalidKeyException Illegal key size

I have a test which runs great on my development MacBook Pro, but fails to run in continuous integration TeamCity server. The error is following: java.security.InvalidKeyException: Illegal key size at javax.crypto.Cipher.a(DashoA13*..) at…
Vladimir
  • 4,782
  • 7
  • 35
  • 56
63
votes
3 answers

How to create a secure random AES key in Java?

What is the recommended way of generating a secure, random AES key in Java, using the standard JDK? In other posts, I have found this, but using a SecretKeyFactory might be a better idea: KeyGenerator keyGen =…
barfuin
  • 16,865
  • 10
  • 85
  • 132
60
votes
7 answers

How to decrypt OpenSSL AES-encrypted files in Python?

OpenSSL provides a popular (but insecure – see below!) command line interface for AES encryption: openssl aes-256-cbc -salt -in filename -out filename.enc Python has support for AES in the shape of the PyCrypto package, but it only provides the…
Thijs van Dien
  • 6,516
  • 1
  • 29
  • 48
53
votes
4 answers

How to fix Invalid AES key length?

I am working on a text encryption and decryption project (following Struts 2) Whenever I enter the password and the plain text I get a Invalid AES Key Length error. The Service Class package com.anoncrypt.services; import java.security.Key; import…
Rishabh Upadhyay
  • 559
  • 1
  • 4
  • 7
48
votes
7 answers

Does AES (128 or 256) encryption expand the data? If so, by how much?

I would like to add AES encryption to a software product, but am concerned by increasing the size of the data. I am guessing that the data does increase in size, and then I'll have to add a compression algorithm to compensate.
Bob Kuhl
47
votes
4 answers

How to do encryption using AES in Openssl

I am trying to write a sample program to do AES encryption using Openssl. I tried going through Openssl documentation( it's a pain), could not figure out much. I went through the code and found the API's using which i wrote a small program as below…
pkumarn
  • 1,383
  • 4
  • 22
  • 29
46
votes
1 answer

Why does my AES encryption throws an InvalidKeyException?

I'm currently working on a function that encrypt/decrypts a specific file with a secret key. I have written three classes, one which generates a key, one which encrypts a file with the key and one that decrypts. Generating the key and encrypting the…
John Snow
  • 5,214
  • 4
  • 37
  • 44
43
votes
11 answers

AES encryption in swift

I'm trying to implement AES encryption in swift. The encryption decryption for Android and C# is working properly. I need to implement it in swift. It's current code for android and C# is followed by this. I tried to use CryptoSwift Cross platform…
Ankita Shah
  • 2,178
  • 3
  • 25
  • 42
41
votes
2 answers

AES encryption how to transport IV

I understand that unique IV is important in encrypting to prevent attacks like frequency analysis. The question: For AES CBC encryption, whats the importance of the IV? has a pretty clear answer explaining the importance of the IV. Would there be…
RunHolt
  • 1,892
  • 2
  • 19
  • 26
41
votes
3 answers

Passphrase, Salt and IV, do I need all of these?

If I am using Rijndael CBC mode, I have no idea why we would need salt. My understanding is even if people know the password, but he cannot get the data without IV. So from my perspective, password + IV seem to be sufficent secure. Do I get anything…
Kelvin
  • 1,103
  • 2
  • 11
  • 16
40
votes
5 answers

How to securely handle AES “Key” and “IV” values

If I use AES (System.Security.Cryptography) to simply encrypt and decrypt blob or memo fields in a SQL server, then where do I store the “Key” and “IV” values on the server? (File, Regkey, Dbase,...) And what with the protection of those AES “Key”…
ChiYoung
  • 836
  • 1
  • 7
  • 12