Jay Taylor's notes
back to listing indexWhat is the difference between CBC and GCM mode?
[web search]
I am trying to learn more about GCM mode and how it differs between CBC. I already know that GCM provides a MAC which is used for message authentication. From what I have read, and seen code snippets of is that GCM does an exlusive or much like CBC, but I'm not sure what the exclusive-or is against. In CBC mode, the exlusive-or is plaintext against the previous ciphertext block, except for the first block which uses a random IV. Does GCM do the same, or does it do the exclusive-or against something else? If so, can someone please briefly explain how GCM uses the IV and how the exclusive-or is done. |
|||||||||||||||
|
|||||||||||||||
GCM and CBC modes internally work quite differently; they both involve a block cipher and an exclusive-or, but they use them in different ways. In CBC mode, you encrypt a block of data by taking the current plaintext block and exclusive-oring that wth the previous ciphertext block (or IV), and then sending the result of that through the block cipher; the output of the block cipher is the ciphertext block. GCM mode provides both privacy (encryption) and integrity. To provide encryption, GCM maintains a counter; for each block of data, it sends the current value of the counter through the block cipher. Then, it takes the output of the block cipher, and exclusive or's that with the plaintext to form the ciphertext. Note two key differences:
As for how GCM uses an IV (I personally consider 'nonce' a better term for what GCM uses, because that emphesizes the idea that with GCM, you cannot use the same nonce for the same key twice), well, it is used to initialize the counter. |
|||||||||||||||
|
Your Answer
Not the answer you're looking for? Browse other questions tagged encryption cbc modes-of-operation gcm or ask your own question.
asked |
4 years ago |
viewed |
22531 times |
active |
Linked
Related
Hot Network Questions
- Can we use battery in reverse to step down a dc voltage
- Can two persons sharing a name travel one-way each on a return ticket?
- Why were Hobbits not included in the old lists?
- Produce a monochrome (pure black and white) pdf using xelatex
- "consists of" or "consists in"?
- Accessing document using a 6 letter token
- Why do we teach complex numbers?
- CS GO command change weaponed hand
- Genders in French: When not sure, always go with masculine?
- What is this canister at the top of a utility pole?
- How to make a city car-free?
- Enter colors directly into notebook?
- Difference between NPK 10-10-10 and say 4-4-4
- Is Daredevil's suit made of vibranium?
- ArcMap spatial analyst, enable extension by default?
Technology | Life / Arts | Culture / Recreation | Science | Other | ||||||
---|---|---|---|---|---|---|---|---|---|---|