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
40
votes
2 answers

How to encrypt file from SD card using AES in Android?

I want to encrypt image from the sd card and store it again in SD card again using AES. The main idea is the application browse an image, then encrypt it when I push a button, then store it in sd card. so my image would be secure. I already succeed…
user1421273
  • 403
  • 1
  • 5
  • 5
39
votes
6 answers

Encrypting a string with AES and Base64

I'm trying to encrypt some text inside a database to be loaded and decrypted during program startup. I have tried a few methods, including a third party library https://github.com/richard-lyman/lithcrypt to no avail. Using the following method…
jawr
  • 827
  • 1
  • 7
  • 14
39
votes
5 answers

java.security.NoSuchAlgorithmException:Cannot find any provider supporting AES/ECB/PKCS7PADDING

I was trying to encrypt data using AES algorithm. However, with the following exception has occurred. java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/ECB/PKCS7PADDING Someone know a solution to this issue? My…
Suby Lee
  • 415
  • 1
  • 4
  • 6
38
votes
6 answers

How to pick an appropriate IV (Initialization Vector) for AES/CTR/NoPadding?

I would like to encrypt the cookies that are written by a webapp and I would like to keep the size of the cookies to minimum, hence the reason I picked AES/CTR/NoPadding. What would you recommend to use as IV that's random enough and still keep the…
Drew
  • 1,332
  • 3
  • 15
  • 21
38
votes
12 answers

AES Encrypt and Decrypt

I write an application by swift, i need AES Encrypt and Decrypt functionality, i received encrypted data from another .Net solution, but i can't find something to do it. This is my .net Encryption: public static byte[] AES_Encrypt(byte[]…
mehr
  • 845
  • 1
  • 9
  • 18
38
votes
4 answers

Does IV work like salt

In AES, my understanding is that salt is the stuff to make the passphrase more secure and it wont be added into encrypted text. But IV is the stuff used to encrypt the first block of message and will be added into the encrypted text. Do I get…
Kelvin
  • 1,103
  • 2
  • 11
  • 16
37
votes
4 answers

Java default Crypto/AES behavior

Does anyone know what the default Java crypto behavior is for: SecretKeySpec localSecretKeySpec = new SecretKeySpec(arrayOfByte, "AES"); Cipher localCipher = Cipher.getInstance("AES"); Specifically I am looking to understand how those classes…
wuntee
  • 12,170
  • 26
  • 77
  • 106
36
votes
1 answer

AES/CBC/PKCS5Padding vs AES/CBC/PKCS7Padding with 256 key size performance java

I am currently using AES/CBC/PKCS5Padding for encrypting files in Java with 256 bytes key size, but while searching I found on stackexchange PKCS#5-PKCS#7 Padding and it is mentioned, PKCS#5 padding is a subset of PKCS#7 padding for 8 byte block…
Deepak Bhatia
  • 6,230
  • 2
  • 24
  • 58
35
votes
6 answers

Encrypt and decrypt with AES and Base64 encoding

I have following program for encrypting data. import java.security.Key; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; public class Test { private static final String…
Harshana
  • 7,297
  • 25
  • 99
  • 173
33
votes
2 answers

AES-NI intrinsics enabled by default?

Oracle has this to say about Java 8 with regards to AES-NI: Hardware intrinsics were added to use Advanced Encryption Standard (AES). The UseAES and UseAESIntrinsics flags are available to enable the hardware-based AES intrinsics for Intel…
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
32
votes
5 answers

AES encryption, what are public and private keys?

In AES encryption (.net framework), how are the public and private keys used? Are the public and private keys combined to form a full key, and then the algorithm uses the public + private key to encrypt the data? (simplified keys used below for…
YOYO
32
votes
3 answers

What causes the error "java.security.InvalidKeyException: Parameters missing"?

I'm trying to encrypt and decrypt a string using AES but getting an error I don't know how to resolve. This is the code: public class EncryptionTest{ public static void main(String[] args) { String encrypt = new…
Igr
  • 965
  • 4
  • 13
  • 26
32
votes
5 answers

What (pure) Python library to use for AES 256 encryption?

I am looking for a (preferably pure) python library to do AES 256 encryption and decryption. This library should support the CBC cipher mode and use PKCS7 padding according to the answer to an earlier question of mine. The library should at least…
Daren Thomas
  • 67,947
  • 40
  • 154
  • 200
30
votes
1 answer

RijndaelManaged vs AesCryptoServiceProvider (AES Encryption)

I needed to encrypt data using AES. While researching I discovered the AesCryptoServiceProvider class. I know very little about encryption and I did not know what the initialization vector (IV) was, so I tried searching for an AES example in stack…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
28
votes
5 answers

AES-256 encryption in PHP

I need a PHP function, AES256_encode($dataToEcrypt) to encrypt the $data into AES-256 and another one AES256_decode($encryptedData) do the opposite. Does anyone know what code should this functions have?
mariannnn
  • 287
  • 1
  • 3
  • 4