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 [cbc]

Cipher block chaining (CBC) is a method for encrypting large amounts of data with a block cipher that can only encrypt fixed length plaintexts. When used with an unpredictable initialization vector (IV), it is secure against chosen plaintext attacks (CPA-secure).

-2
votes
1answer
59 views

Looking for AES CBC algorithm example [closed]

That sound strange but I don't find in network psudoCode/c#/c/python clear code that show how AES CBC working. I will be happy to see code like that / movie with examples with hex byte to see how it ...
0
votes
0answers
61 views

Proof that CBC mode is not IND-CPA with predicable IV [duplicate]

How can you prove that CBC is not IND-CPA secure if the IV is implemented as a counter starting at 0 and increasing by 1 each time?
2
votes
1answer
287 views

Security of AES after key expansion 4-MB with ECB and CBC

My question is, how does the security depend or change if I encrypt with AES-128 in total 4-MB of Data? With Electronic Code Book Mode and Cipher Block Chaining Mode ? Does an adversary still ...
2
votes
2answers
165 views

The attacker model of the Lucky13 attack in TLS

Lucky13 is a timing attack against the MAC in the CBC MAC-then-encrypt ciphersuites. In the attack's page: The attacks involve detecting small differences in the time at which TLS error messages ...
2
votes
2answers
90 views

Replacement for XOR in CBC?

In CBC mode, the XOR operation is used to combine the previous encrypted block with the current plaintext, to be used as the block to encrypt. Apart from other known disadvantages inherent to the mode ...
1
vote
1answer
88 views

CBC related TLS cipher suites to be disabled in the server side

I understand the TLS cipher suites using CBC mode are susceptible to timing attacks. From that understanding it seems that the cipher suites using GCM (CTR-based) are safe to use considering they don'...
1
vote
1answer
112 views

With DES, is ECB encryption mode equivalent to CBC with null IV for short data blocks?

I got to this by experimentation, but can someone maybe provide an explanation for this?
0
votes
1answer
60 views

How is a PRP different from PRF? Both can be inverted to get the same input

PRP is said to be a bijective function which means that there is a one-to-one mapping with the output. And hence the output can be inverted using the decryption algorithm to get the same input. ...
-4
votes
1answer
67 views

AES without mode operation

i have field in database. ex: field name. this field maybe more than 16 byte. how to encrypt data more than 16 byte without cbc, etc? any function or another ways to do this?
3
votes
1answer
216 views

Is DES secure under CBC?

I know DES is outdated, but will is is secure in CBC mode? Can anyone help me understand why not?
3
votes
1answer
268 views

Why can't decrypt with OpenSSL if salt changed (for CBC and ECB)

A file encrypted with OpenSSL (with, for example, AES 256-bit mode CBC) using the Linux command openssl enc -aes-256-cbc -in texte -out encrypted_texte -k password ...
1
vote
1answer
46 views

What happens if the plaintext $m1$ from the first block of CBC is known to adversary?

The adversary is has unlimited access to the encryption oracle. My thinking is that upon receiving the ciphertext C = $<c_0,c_1,c_2...,c_n>$ it will just use $c_0$ to XOR it with $F_k(m_1)$ to ...
0
votes
1answer
31 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
votes
1answer
92 views

Which block cipher mode to use?

I am working on securing a chat application, and I am not sure about which block cipher mode I should use. I am aware that I should avoid ECB as it's insecure, but what about CBC? I have watched ...
1
vote
1answer
261 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
1answer
212 views

Is AES-CBC mode not secure against chosen cipher-text attacks even if the IV is not predictable?

I've seen questions where people have asked if AES-CBC mode is vulnerable to chosen cipher-text attacks if the IV is predictable. But is it guaranteed to be secure against chosen cipher text attacks ...
1
vote
2answers
72 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 ...
0
votes
1answer
108 views

Cipher Block Chaining (CBC) encryption in SSL

Is cipher block chaining (CBC) mode used in SSL encryption? If block reordering is already protected by SSL and TCP sequence numbers, what added advantage does CBC provide?
1
vote
2answers
81 views

Cipher Block Chaining Ciphertext Alteration

I am new to cryptography. My professor's slides say that "Disadvantage: altered ciphertext only influences two blocks" for the CBC. However, since we xor the ciphertext from the previous block and the ...
3
votes
2answers
299 views

Choice of padding scheme to prevent CBC padding oracle attacks?

I was watching a lecture about the padding oracle attack on CBC mode block ciphers, where the padding scheme used was PKCS#7. My question is can padding oracle attacks be prevented (without any use ...
1
vote
2answers
48 views

How to provide partial confidentiality and full integrity for a protocol message?

I want to provide confidentiality and integrity for a protocol. I don't want to encrypt the entire protocol message. I do not want to encrypt the header and timestamp of the protocol message, but I ...
0
votes
1answer
74 views

Can I use PKCS#5 with CBC? [duplicate]

As far as I know there are two padding mechanisms, which are PKCS 5 and 7. Which one should be used for CBC?
3
votes
3answers
642 views

When do I need to use CBC and HMAC?

As I know CBC does not provide integrity for the message, thus HMAC is used to provide integrity for CBC message. Also, I hear about CBC-MAC which can provide integrity and confidentiality. Which one ...
1
vote
0answers
49 views

Can blocks in AES-CBC ciphertext be manipulated in such a way that plaintext becomes shuffled?

Say we have a sequence of N 16-byte plaintext blocks encrypted using AES in CBC mode, with an IV, resulting in N+1 16-byte ciphertext blocks. Can this ciphertext be manipulated in such a way that, ...
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
104 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 ...
3
votes
0answers
111 views

AES key reuse between CTR and CBC

The question Given the same plaintext content that is encrypted two times. One time with AES-CTR and the other time with AES-CBC. Both times with the same AES key but with different IVs. What are ...
2
votes
1answer
98 views

Is it safe to use unauthenticated AES CBC when encrypting random bytes?

I am studying an application with an AES crypto implementation that works that like the following: PBKDF2 is used with X iterations and SHA-256 to generate a 256-bit "master key" from a user-provided ...
-1
votes
1answer
242 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 ...
3
votes
1answer
55 views

Propagating CBC insecure Authenticated Encryption

why is Propagating CBC (PCBC) insecure for authenticated encryption? I received the hint that I should feed a message of length $n$ and a message of length $n-1$ to it, but I don't really get what the ...
2
votes
2answers
76 views

How much data do I leak if I use the first bytes of a file as AES-CBC IV?

I found a piece of code that uses the first 16 bytes of the input file as IV. This immediately set off some flags in my head, but I have no idea how bad it really is. So, how bad is it? Obviously we'...
3
votes
2answers
736 views

Are TLS 1.2 AES-CBC and AES-GCM Authenticated Encryption ciphersuites?

In the answer of the following post: Why was AES CBC removed in TLS 1.3?, I quote the following from the chosen answer: After the Lucky13 attack (a timing oracle caused by MAC-then-encrypt), it ...
0
votes
2answers
66 views

Modification of block cipher in CBC mode

I know that CBC is not secure against data modification. Can someone explain to me by illustrating at an example how I could change the last block if I have the encryption of "0"? Thanks in advance
1
vote
1answer
590 views

AES-CBC then SHA vs AES-GCM for encrypting and authenticating a web token

I am trying to have something like JWT but kinda ad hoc and encrypted. The token itself is simply a stringified JSON that contains the user ID and Unix timestamp. Now, I tried to use AES-128-GCM, ...
0
votes
1answer
83 views

CBC first block malleability

Let $m_1 = \underbrace{ \{0,1\}^n \times \cdots \times \{0,1\}^n }_{L\text{ times}}$ be a message of space $\mathcal{M}^L$, where $\mathcal{M} = \{0,1\}^n$. Let $c_1$ be the encryption of $m_1$ ...
0
votes
1answer
150 views

CBC-MAC using predictable IV

Imagine you have a string of plaintext (a), IV (ai) and the MAC (am) for the plaintext (<...
3
votes
2answers
199 views

Is CBC block cipher mode susceptible to reordering attacks?

Regarding reordering attacks, is CBC block cipher as vulnerable as ECB? why? If CBC can prevent reordering attacks (that is, after reordering, the decrypted plaintext will make nonsense so the ...
8
votes
5answers
2k views

Are there any benefits to using ECB over CBC?

From what I have understood about ECB and CBC, CBC is far better as it doesn't reveal any pattern. There have been several questions here about how ECB is bad: Should I use ECB or CBC encryption mode ...
5
votes
2answers
369 views

Can AES-CBC be safely used in combination with RSA, or must it be CBC-MAC?

The plan is to encrypt files using an AES-256 in CBC mode secret key. The secret key itself will be encrypted with a RSA 2048-bit public key. Is using AES-CBC sufficiently secure if used in ...
1
vote
1answer
141 views

Is zero IV with AES-CBC safe if CPA is not possible and indistinguishability is not an issue?

Is using zero IVs with AES-CBC safe, if chosen-plaintext attack (CPA) is not possible and ciphertext indistinguishability is not an issue? Practical example: ...
2
votes
2answers
433 views

AES CBC: how shall i get to know with AES CBC method, the received Cipher Text is padded or not [closed]

Algorithm: AES - CBC mode with PKCS7 padding KeyValue: 10a58869d74be5a374cf867cfb473859 IV: ...
3
votes
1answer
259 views

CBC - Cipher-text stealing decryption

(I asked in stackoverflow and I should ask my question here not there, sorry about that) The graph shows CBC- with cipher-text stealing and (b) is the block length. The output cipher-text is c1,...,...
-2
votes
2answers
317 views

ciphertext stealing and CTR

Why Does CTR mode encryption not use ciphertext stealing?
0
votes
0answers
684 views

Triple DES encryption/decryption in nodejs

In Delphi , we are encrypting the password using TripleDESEncryption algorithm. We use the key as an array of byte [0..15]. Then the input string is converted is first saved to stream and then sends ...
0
votes
0answers
64 views

Custom attack to CBC in IPsec

I have this exercise in my book and I got no starting point so far. We describe an attack of the CBC mode in IPsec. In this mode, a sequence of blocks $x = x_1, ..., x_2$ is encrypted with a key $K$...
0
votes
1answer
222 views

CMAC Generation : If input payload length is not aligned in 16 bytes, what are the possible side effects?

While searching for answers ,I understand that RFC AES-CMAC 4493 is suggested by NIST to overcome if payload is not aligned in 16 bytes. I would like to know what drawbacks/insecure caused by AES-...
0
votes
0answers
228 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
3answers
3k views

Can we calculate AES ciphertext length based on the length of the plaintext?

I am currently using AES256 in CBC mode with PKCS7 Padding to encrypt some data. It seems like the output size is not always a power of two, which was what I expected. Is it possible to calculate the ...
1
vote
2answers
608 views

CBC Mode error during encryption

In CBC mode I know that if i get a corrupted Ci* block than Pi and Pi+1 will be wrong during the decryption, but i believe that this happens only when Ci* is not envolved during the feedback stage at ...
1
vote
1answer
94 views

Cut through mode for TLS AES-CBC / SHA ciphersuite

I am looking at RFC5246 and it seems that AES-CBC/SHA cipher suites cannot be implemented in a cut-through mode. Let's suppose that received record spans two segments. As i understood HMAC ...