Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [initialization-vector]

Unique data used by block cipher modes of operation to randomize the output in order to achieve semantic security. Also for other similar constructs in other iterative algorithms.

1
vote
1answer
25 views

AES-256-CBC with random IV - storing same plaintext as same ciphertext

I am encrypting some information stored in a column of a MySQL database. The column can contain repeated values, let's say the table has 7 rows and the column to be encrypted has the following values:...
-1
votes
0answers
31 views

AES-CTR mode using different key's generated trough PBKDF2 in case at least two IVs repeat

Supposed that a client has AES-128 bit randomly generated static key The client is using a PBKDF2 in order to to generate a vector(list) of keys i.e. target keys to leverage will be located ...
1
vote
2answers
52 views

Why can´t an attacker find the key if he has the plain text, the IV and the ciphertext? [duplicate]

I am reading a book about web security and they are now talking about AES CBC. After reading the chapter I was wondering, can an attacker compute my secret key if he has access to the IV, the plain ...
1
vote
1answer
37 views

With AES-GCM, may I use multiple tags per key?

In my implementation of AES-GCM, the key might change only once per minute. However, I wish to calculate a new tag every 6us, to reduce latency (since you have to buffer up a GCM "packet" before ...
2
votes
2answers
91 views

Safely erasing encrypted data

My secret message is encrypted in a byte buffer with AES-128 in CBC mode. The first 16 bytes are the IV and the message follows contiguously. If I want to securely delete this message is it enough ...
2
votes
1answer
90 views

Is an IV useless for encrypting database IDs?

In my scenario I need to build a pseudo-anonimization service: a machine that given a plainID return a chiperID and vice-versa. <...
4
votes
1answer
156 views

Crypto-shredding a file by erasing the IV instead of erasing the Key

Imagine an authenticated, encrypted file system, which uses AES-256-CTR to encrypt a 64 KB file sector, then uses HMAC-SHA256 to authenticate the 64 KB file sector (including the IV). IVs are 128-bit, ...
1
vote
1answer
50 views

Simulation of Chosen Plaintext Attack on CBC, Predictable IV with OpenSSL

I would like to simulate the CBC IV attack where the IV is predictable. It's described in the answer to this question: chosen plaintext attack on CBC, predictable iv (Only "Yes" and "No" are valid ...
0
votes
1answer
44 views

Recovery of private key in AES-CBC from two ciphertexts with different IV, but identical plantext

I have a system that encrypts messages for a given user using key K using AES-CBC in response in an external stimulus. Each message has a randomly generated IV. The user never decodes these messages,...
1
vote
2answers
66 views

Encryption using deterministic CSPRNG as secure as CSPRNG

As a beginner it seems that a scheme derived from a CSPRNG should be as secure as that CSPRNG. Is this a correct assumption? Are there restrictions or known special cases? A rough outline would be: ...
2
votes
1answer
69 views

Does it matter how the IV and XOR are applied for a single AES-128 block?

I want to encrypt 128 bits of data. I understand the problem with ECB, so I generate a 128-bit Initialization Vector to use for encryption and send with the encrypted data. Is there a "best" way to ...
0
votes
2answers
75 views

Can I find the IV of a single block of SHA256, given the plaintext and digest?

Each 512-bit block of SHA256 takes an initialization vector (IV) and message schedule and returns a digest. Knowing the message schedule and resulting digest, is it feasible to reverse the algorithm ...
1
vote
1answer
315 views

Decrypting an encrypted aes 256 cbc text with random IV, decrypts the string [duplicate]

This may be a basic question but bear with me. I started encrypting a text with aes 256 cbc mode generating a random iv of 16 bytes and a key. ...
1
vote
2answers
73 views

Encrypting current time using 3DES as a signature

I came across a peculiar system for generating "signatures" ("signatures" is within quotes because this is a bad use of 3DES) in the wild. It works as follows: a symmetric key is generated and used ...
1
vote
1answer
187 views

Does an IV need to be used in AES CTR mode?

If I encrypt a message once using AES CTR, will I need an IV? Additionally, if I do use an IV, will I need to send with with the cipher text?
4
votes
1answer
153 views

Is it ok to transmit an IV as a custom HTTP header?

Considering an AES OFB encryption algorithm, suppose that I'm sending a message over HTTP (not HTTPS) and my message body contains the cyphertext. I'd like to know if transmitting a random ...
1
vote
0answers
43 views

Help decrypting AES-256-CBC data with bad initialization vector of 0xC0FFEE

For a game I am trying to decrypt data that was originally encrypted using AES-256-CBC given a key and the following initialization vector: 0xC0FFEE The initialization vector appears to be short, ...
0
votes
1answer
94 views

Is encrypting multiple message with same key and iv secure for this case? [duplicate]

AES256, CBC IV is sha512 of key. Ek[random padding | message | random padding] How much information would be leaked from the use of the same IV & key in this way, assuming the adversary has ...
8
votes
2answers
396 views

Which attacks are prevented by the different initial hash values for SHA-2 with truncated output?

NIST specified SHA-2 hash functions with truncated output. Those hashes use different initialization values than SHA-256 or SHA-512. SHA-224 is based on SHA-256. SHA-384, SHA-512/224 and SHA-512/256 ...
0
votes
1answer
41 views

Encryption / Decryption method secure

I was wondering whether this encryption / decryption flow is very solid / secure. I encrypt the data using AES CBC 256 bit with an static IV. When the user logs in with his Firebase account (first ...
0
votes
2answers
120 views

TLS1.2 AES 128 CBC Encrypted Data size is not a multiple of block size [closed]

I know that TLS ciphers such as TLS_RSA_WITH_AES_128_CBC_SHA transmit data as shown https://tools.ietf.org/html/rfc5246#section-6.2.3.2. From my understanding the ciphertext MUST be a multiple of the ...
2
votes
1answer
115 views

Would it be safe to use the message hash as the IV in ChaCha?

This seemed like an option if the hash is unpredictable. It could be the hash of the message or the hash of the message + some common secret (apart from the key). The only circumstance in which the ...
0
votes
1answer
60 views

Sending the nonce in ChachaPoly1305 with the ciphertext

I am trying to implement a ChachaPoly1305 encryption with authentication scheme over a network. I am using a counter to derive the nonce as suggested by the rfc. Is it secure to send the nonce over ...
-1
votes
1answer
282 views

How can you change this message which is in block cipher AES-256 in CBC?

Given is the secret message encrypted with AES-256 in CBC mode 5a04ec902686fb05a6b7a338b6e07760 14c4e6965fc2ed2cd358754494aceffa The first 16 Byte is the initial ...
4
votes
3answers
259 views

Reusing IV in AES for encrypting file

Everyone says that you shouldn't use the same IV and Key. Is it safe to use the same IV and Key on only one file. EDIT: I will be using CBC or CFB encryption modes so the IV will be updated based on ...
3
votes
2answers
100 views

Generate $J_0$ for GCM cipher when $\operatorname{len}(IV) \neq 96$ bits

I have the following questions about the construction of J0 when is not equal to 96 bits, $s= 128\big\lceil \operatorname{len}(\text{IV})/128\big\rceil-\operatorname{len}(\text{IV})$ For example if ...
0
votes
2answers
63 views

Does selecting a set of random numbers for the key and IV insure security?

For AES 256 - if I use a random 32 byte sequence for the 256 bit key and another 16 byte for the 128 bit initialization vector, does this insure that my cipher text cannot be broken in any short ...
2
votes
1answer
166 views

Do aes_256_gcm IVs just need to be unique for that key?

I'm using GCM (via openssl's EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL))). The IV's default length is 12 bytes. It says that the IV must be ...
-1
votes
4answers
180 views

IV vector is not random. Is it critical?

Reading the spec of one of the IoT protocols, I found that IV for it one isn't actually random, it consist of $n$ bytes that represents manufacter-specific string; the same for all devices plus 6 ...
4
votes
4answers
530 views

Text partially decrypted regardless of IV

I'm trying to work out which AES cipher is best to use. I'm working with the OpenSSL ruby gem. While testing the various options I noticed that most of the ciphers result in partial or even full ...
6
votes
4answers
4k views

Is using the same IV in AES similar to not using an IV in the first place?

So if I understand how an IV works with AES, I'm supposed to generate a different IV for every message because using only a key, I will get the same encryption if the message was encrypted twice (...
0
votes
1answer
312 views

AES in OFB mode and IVs

I'm trying to understand cryptosystems and their implementations to understand how to properly implement them. I have a function implementing AES-128 in OFB mode. Let's call it ...
0
votes
1answer
61 views

WEP - Vulnerable IV

When performing a FMS attack, why does the attacker have to look for a specific IV, namely, in the form of (A+3, N-1, X)? Why can't he just use any IV? This might be a naive question but I really can'...
2
votes
3answers
566 views

What is the role of IV in Stream Cipher? Why is it needed and what is it's importance?

I ran into this problem when I read the stream ciphers and did not find a satisfactory answer. Why is an IV needed in stream ciphers, and what is the importance of using it?
0
votes
1answer
170 views

AES in CTR mode, with a single key, and an IV derived from the plaintext

We need a system to compare cipher-texts for equality, without (the checking system) having access to the plaintext. We found a library that uses AES in CTR mode, with a single key, and an IV based ...
0
votes
1answer
352 views

When it is safe to reuse IV? (or not using at all)

This is my case: I don't have padding oracle (the server provide the data and users never able to execute the encryption function), I never encoding the same text twice. The text is always short - ...
0
votes
0answers
231 views

how decryption takes place in aes-256-cbc ,where encryption done by random keys?

if encryption takes place by using random keys in CBC then how it will decryption done with a randomly created cipher text
1
vote
1answer
302 views

Security of a sha-256 based stream xor cipher?

Provided that I have some data I want to cipher and a password to do it: I generate a random IV I define c = sha256(password) I generate an infinite stream where <...
2
votes
0answers
229 views

Seekable cipher, is AES CTR a good solution?

I'd like to create a simple file-cipher, which provides seekable encryption (so I can decrypt any part of the encrypted message, without the need of decrypt from the start). Here's my current idea: I ...
0
votes
1answer
658 views

The IV for AES-128

I'm trying to understand this: [AES_128] REQUIRES the same 16-octet Initialization Vector (IV) to be supplied when encrypting and decrypting. Varying this IV increases the strength of the ...
0
votes
0answers
23 views

AES CBC Transfer vnitialization vector via HTTP [duplicate]

I'm developing application and there will be functionality to encrypt payload with AES CBC by client, and send it on server for storing. But I need to use random IV every time, to make it reliable. ...
4
votes
1answer
326 views

In a AES-CBC + HMAC architecture, Is it secure to send a second IV in a message to a device incapable of producing satisfactory random numbers?

There are many threads here explaining the need of a random and unpredictable IV for the AES-CBC. I am building a home automation system with security for a school project where a Raspberry Pi ...
1
vote
1answer
623 views

Get IV from Key, Clear and Cipher text in AES-256 CBC

Newbie question here but can I get the IV if I know the Key, plain text and chiper text ? (I thought that if I encrypt 16 first bytes of clear with the key and 16 first bytes of cipher text as IV it ...
0
votes
1answer
233 views

Given an AES-CBC encrypted string, IV, and plain text, how can I compute the key?

If I have the AES-CBC encrypted string along with the IV and the plain text before encryption, how can I compute the key which was used for encryption?
6
votes
1answer
669 views

Deterministic Encryption with AES GCM - how to choose the IV (nonce)

I have not a very large background in cryptography so I hope these questions are not very dumb. I don't want to reinvent the wheel, I'm just looking for advise on the best practices about how to build ...
2
votes
1answer
70 views

calculate ESS IV initialization vector for aes- bc essiv encryption

I want to do block level encrypton on my ext4 image file system with aes-cbc-essiv How can I find/calculate the the ESSIV needed for encryption?
3
votes
3answers
395 views

Do I need to generate unique IV for CBC encryption of a file if I encrypt multiple blocks of data?

The situation is that I download a mp3 file (song) and I encrypt blocks of data (4096 bites for example). The output of every encryption operation I save it in a new file. When I play the song (...
4
votes
2answers
1k views

Why does openssl derive IVs from a password?

From https://wiki.openssl.org/index.php/Manual:Enc(1): When a password is being specified using one of the other options, the IV is generated from this password. Why does OpenSSL do this? My ...
0
votes
2answers
152 views

How to stop an attacker from repeating the same ciphertext?

I have this situation where a PC is connected, via RS-232, to a certain hardware module that controls industial machinery. The hardware is supposed to receive commands to turn on or off these ...