Questions tagged [initialisation-vector]
The initialisation-vector tag has no usage guidance.
51
questions
1
vote
1
answer
124
views
Changing openssl key/IV when encrypting diffrent rows of data in database?
I'm looking for a way to encrypt data in MySQL database securely. The data come from a web interface from a POST form and each POST request from the user insert a new line in the database.
Right now, ...
1
vote
1
answer
2k
views
AES-256-GCM transfer IV and AuthTag
Question is for transfer encrypted data between two services (Like HTTP, GRPC or etc...) Can I transfer IV and AuthTag in plain, Is this approach secure?
I have sample code in Node.js and I'm not ...
0
votes
1
answer
1k
views
Reusing the IV, but not the key
There are a few questions on this site asking about reusing the same initialization vector for example for AES encryption under the same key, see for example this question.
Now, let's not respect that ...
1
vote
3
answers
287
views
In Algorithm: dh-ietf1024-sha256-aes128-cbc-pkcs7 where to get the IV?
I'm implementing dh-ietf1024-sha256-aes128-cbc-pkcs7 in golang and according to documentation I've managed to create the 128-bit key appropriate for AES (from my 1024-bit shared-key computed from my ...
3
votes
3
answers
383
views
Why use an IV when the message length is only one block?
I have read that IV's are used with block ciphers in case a sequence is repeated in a message and produces repeated sequences in the ciphertext.
I see IV's being used in cases where the message is ...
1
vote
1
answer
482
views
Can't recover IV from openssl output
Reading other posts like this one give me the impression that the iv can be retrieved from an openssl enc output, and indeed, I see that under one circumstance, it works:
# These two commands print ...
4
votes
1
answer
338
views
Can I HMAC my plaintext for use as a NACL SecretBox nonce?
I'm writing an application that needs to deterministically encrypt some data (where two equal ciphertexts will produce two equal plaintexts; this is acceptable and in fact desirable for this ...
4
votes
1
answer
7k
views
Is the original IV mandatory to decrypt an encrypted message?
TL;DR
If we encrypt a message with an IV, do we need to store this specific IV somewhere to ensure that we're able to decrypt the message later?
There isn't much I know about this. From my ...
0
votes
0
answers
170
views
Reused key issue in Asymmetric Encryption
We all hear often about the reused key issue in block cipher.
For example, for a picture being encrypted by the electronic codebook mode, we will still see the shape of the picture.
https://images.app....
0
votes
1
answer
818
views
AES-256 ESSIV in dm-crypt
I am playing around with disk encryption. https://gitlab.com/cryptsetup/cryptsetup/-/wikis/DMCrypt#iv-generators says:
essiv: "encrypted sector|salt initial vector", the sector number is encrypted ...
1
vote
1
answer
7k
views
Decrypt file using Key and Initialization Vector in Linux
I am Salesforce developer but new to the Security World as well as Linux. We encrypted a file with Key and initialization Vector in Salesforce(only symmetric encryption is possible in Salesforce). No ...
0
votes
1
answer
1k
views
How to translate "openssl enc" command to nodejs crypto api
I have been successfully using openssl to encrypt a large file. I'm trying to develop the equivalent nodejs crypto API code for the following openssl commands:
openssl rand -hex 64 -out {keyfile}
...
2
votes
4
answers
1k
views
Losing the Initialization Vector in Cipher Block Chaining
I have written a message and encrypted it using cipher block chaining.
What will happen if the receiver loses the Initialization Vector, or doesn't receive at all?
-1
votes
1
answer
2k
views
Reuse of IV for AES CTR stream cipher [closed]
Wikipedia describes the following about IV reuse for stream cipher: For OFB and CTR, reusing an IV completely destroys security. This can be seen because both modes effectively create a bitstream that ...
0
votes
0
answers
610
views
Problem using padding oracle attack on this base64 - url coded message (AES CBC 256)
I'm supposed to write a script that will get the plaintext of a message which is firstly coded in base64, then URL coded (encoded ciphertext in AES-256-CBC). Padding is used as well such that the ...
3
votes
1
answer
2k
views
How can you change the plaintext of the given secret message which is in AES-256 CBC
Say you have the secret message encrypted with AES-256 in CBC mode
5a04ec902686fb05a6b7a338b6e07760 14c4e6965fc2ed2cd358754494aceffa
where the first 16 Byte is the initial vector, the second 16 Byte ...
1
vote
0
answers
540
views
Security of "queryable" encryption?
Spring Security has a utility method called Encryptors.queryableText. The explanation for it is:
The difference between a queryable TextEncryptor and a standard TextEncryptor has to do with ...
2
votes
1
answer
657
views
Should I store my encrypted password's salt and initialization vector as clear text?
I'm encrypting some file with AES-256-CBC, and I'm planning to store the cipher text in a json file, with something like:
{
"data": "0123456789ABCDEF...",
"salt": "00123ABCAABBCCDD...",
"...
0
votes
1
answer
691
views
Is it safe to include the IV at the end of a hash?
I have a PHP function I have written that uses a 64 bit binary string and a random initialization vector to encode data using the following basic principal:
$encrypted = openssl_encrypt($...
2
votes
2
answers
8k
views
How to store an AES Key? an Initialization Vector(IV)?
I'm currently developing an authentication service for our company. I somehow understand how to store a salt used in hashing a password in that it should be stored together with the hashed password. ...
11
votes
1
answer
1k
views
OpenSSL EVP aes_256_cbc Initialization Vector Size
I'm looking at the crypto library examples (programmed in c) provided for OpenSSL EVP on OpenSSL Wiki.
Their example for a 128 bit Initialization Vector is as follows:
/* A 128 bit IV */
unsigned ...
1
vote
1
answer
2k
views
Is it secured to store the encrypted key in the database (encrypted by other cipher)?
I want to improve the encryption flow used by my application.
Today I use the AES cipher while its key and its IvBuffer are hardcoded in the code.
I know it is not secured and I want to improve this.
...
1
vote
2
answers
9k
views
AES-256-CBC encryption IV vs salt when encrypting files with a secret key
I am writing a small class to add to my application that will handle things like config secrets. (I don't want to get into this topic as a lot of research has gone into the approach we've decided to ...
1
vote
2
answers
3k
views
Regarding number of packets needed to crack WEP
One of the major weaknesses of WEP is a short 24-bit IV, which means that only 224 packets are needed to exhaust all IVs. 224 translates to about 16.5 million IVs (or packets for that matter).
...
2
votes
1
answer
2k
views
Choosing Key and IV in AES-256
I am working on a real-life project for a firm. I have to encrypt data using AES 256 as per specification. I want to know how are the key and IV are really chosen in real world projects. /dev/urandom ...
24
votes
6
answers
17k
views
Why does IV not need to be secret in AES CBC encryption?
According to Wikipedia, the initialization vector (IV) does not have to be secret, when using the CBC mode of operation. Here is the schema of CBC encryption (also from Wikipedia):
What if I encrypt ...
0
votes
1
answer
384
views
AES-CTR with PBKDF2 for IV for file archiving at server. Is this ok?
I have tried to grasp enough of encryption/hashing to be able to implement a secure storage for files, server side. Once I have it down to reasonably safe I'll go over it with an expert. There is no ...
3
votes
1
answer
342
views
Is having a unique key to encrypt data not sufficient
Is it necessary to use a unique Initialization Vector (IV) with various cipher modes of operation (e.g. CBC) even though I use a unique key to encrypt plain text every time?
It is said that an IV ...
3
votes
2
answers
940
views
Could I use a TimeStamp also as IV?
For an academic application, I use AES-GCM to encrypt my frames between 2 parties.
To enhance security, and reduce the possibility of replay, I'd like to use a TimeStamp in my frame exchanges. But, ...
2
votes
2
answers
1k
views
Is an Initialization Vector (IV) required with unique data?
When used to encrypt data that is unique, is an Initialization Vector (IV) still required? For example, Credit Card numbers or Social Security numbers.
The ultimate point of an IV is to ensure that ...
6
votes
1
answer
782
views
Using AES with same salt / IV - required for pattern matching algorithm
I need to securely encrypt data we are storing, but for each client I need the same plaintext to encrypt into the same cypher text. The reason for this is the data is still required for a pattern ...
2
votes
0
answers
134
views
Determining time it would take to exhaust IVs on 802.11b/g/n
I'm trying to learn about WEP attacks at the moment. I know that attacks against WEP require collisions of the initialization vectors. Is there a way to determine how long it would take for the ...
5
votes
2
answers
3k
views
Two ways of generating the IV
I'm looking at some code, and in a particular scenario, the code would need to generate two IVs.
The second IV-generating code simply uses the C# Rijndael GenerateIV()
The first IV-generating code ...
3
votes
1
answer
3k
views
How to implement encryption/decryption system using IV between mobile app and web service
In my app we are going to send encrypted data to the web service. I am using the following code to encrypt and decrypt the data -
public class DecEn {
private static final String password = "test"...
25
votes
4
answers
71k
views
Encrypting using AES-256, can I use 256 bits IV?
I want to encrypt data using AES in java, and I want to intialize the cipher with Initialisation Vector.
Can I use 256-bits IV ? Or I must use only 128-bits IV ?
5
votes
1
answer
364
views
Do IVs need to be unpredictable?
I am encrypting a sequence of messages with AES/CTR.
For each sequence, I generate a random initial IV, say IV(0).
Define IV(i) = MD5(IV(i - 1)) for i = 1, ..., n.
Then for each message m(i),
I ...
3
votes
1
answer
672
views
For use with RC4 how do I combine a reused key and an initialization vector
I am an a-level student writing an encryption program using an rc4 implementation I have written myself. I have the basic algorithm coded correctly (and I have checked that some ciphertext for a given ...
0
votes
0
answers
398
views
Cryptographic Testing
Given an algorithm (say, AES), how to create/generate test vectors?
I have tried using the NIST test vectors for AES and found it to be working fine with a package of "chilkat". Suppose, for a ...
8
votes
2
answers
2k
views
Can the IV + Salt be the same?
During my encryption app i've got the password creation bit:
PBEKeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 10000, keyLength);
and later on the actual encryption part:
cipher.init(...
9
votes
2
answers
15k
views
What's the point of the nonce in CTR mode?
Does having a nonce in CTR mode actually improve security (vs. just using 1, 2, 3, etc. - basically a constant nonce of 0)?
As far as I can tell, the best-case scenario security-wise is that the ...
8
votes
2
answers
21k
views
Is Salt, IV and Key necessary when encrypting password in a database using AES? If so, how should they be used?
Imagine I have a website with user accounts. I want to authenticate users, so I need to know if the password they provide matches the one stored in my database. To protect the passwords from prying ...
1
vote
1
answer
1k
views
How to generate Initalization Vectors correctly
I'm working on a project that splits large files into several encrypted fixed-size blocks (e.g. 4KiB).
Those blocks shall be used to be stored persistently on a storage device.
Blocks are encrypted ...
11
votes
2
answers
46k
views
Why would you need a salt for AES-CBS when IV is already randomly generated and stored with the encrypted data?
I was looking at this code and came across these comments which says encrypting without a salt is insecure. Why would it be insecure when you are already using a random IV for each value? I think the ...
0
votes
1
answer
970
views
encrypting a file with an RSA key
I wrote a java program to encrypt and decrypt files using AES algorithm in CBC mode and a random initialization vector. but there is something fundamental I'm not understanding:first I generate a ...
3
votes
3
answers
3k
views
Is there an attack that can modify ciphertext while still allowing it to be decrypted?
Is there any way an encrypted file using AES-256 could be modified without alerting the file owner, ie., so it can still be decrypted with the same key?
I know that without an initialization vector ...
5
votes
2
answers
19k
views
Using AesCryptoServiceProvider in C#, should using an incorrect IV mangle just the first block?
This question was also asked on StackOverflow, but with no answers, and I thought this may be a better exchange, since I have the same question.
https://stackoverflow.com/questions/9331984/using-c-...
31
votes
2
answers
32k
views
Should AES always give the same output?
I'm having trouble understanding AES and would like to know if encrypting the same text with the same key two times in a row should give the same output.
Is there any salt or something that would ...
14
votes
3
answers
2k
views
How do poor-quality initialization vectors affect the security of CBC mode?
(If the consensus is that this question belongs on crypto, rather than here, please feel free to [tell me to] migrate it.)
From what I have read (looking specifically at AES in Cipher Block Chaining ...
2
votes
1
answer
282
views
Is it safe to derive an IV partially from the secret data if it is hashed before use?
To help ensure uniqueness of IV's used in a CFB AES-256 cipher, software I know of gathers bits from various sources including the plaintext being enciphered, and runs that through an SHA-256 hash. ...
6
votes
3
answers
5k
views
Incrementing Initialization vector by 1
Suppose that we do not generate initialization vectors randomly (using AES in CBC mode). Instead it is initially all zeroes and we increment it by 1 each time a message is encrypted. How can this ...