Counter Mode (CTR) is an encryption mode, that builds a random-access stream-cipher from a block-cipher.

learn more… | top users | synonyms

0
votes
1answer
31 views

Questions regarding parallel AES CTR with merkle trees

I'm planning to implement a parallelizable variant of AES to end-to-end-encrypt files in a web application. As a mode of operation I'm most likely gonna use CTR mode with a 64 bit IV and 64 bit ...
0
votes
0answers
20 views

Do I need output buffer to be multiple of AES block size for CTR mode? [migrated]

In my C code, I use OpenSSL's AES in CTR mode for encryption via EVP interface, that is I have something like this: ...
1
vote
1answer
53 views

Can we use a sort of “hash” function in CTR mode instead of a block cipher? [duplicate]

CTR mode does not use the decryption function at all, only the encryption function. This may suggest that a different primitive that has this "one-way" property could do the trick. For instance, I ...
1
vote
0answers
32 views

Authenticating a range of a ciphertext

I have some data that I CTR-AES-256 encrypt already. I am aware of ways to validate the integrity of the entire file (ie: a separate MAC of the plaintext, or encrypt then MAC, etc). But none of ...
3
votes
1answer
52 views

What is the LENGTH parameter in EEA2?

In the EEA2 option for encryption in LTE the AES-128 algorithm is mechanized. There, the nonce used in the CTR Mode is a 128-bit value. The first 64-bits are covered by a COUNTER, a BEARER, a ...
0
votes
3answers
387 views

CTR HMAC SHA256 implementation

After trying to invent my own AES mode, I decided to just implement something that's known to work, namely CTR with HMAC SHA256. From what I understand, I can use the IV as a counter, and the IV ...
0
votes
0answers
44 views

Message length for aes 256 in ctr, ecb and cbc mode

I want to encrypt a message that have values between 0 and 50. So message have maxim 1 byte. Is possible to encrypt with aes256 in ctr, ecb and cbc mode, messages from 1 byte, not necessary 32 bytes? ...
10
votes
1answer
2k views

Why not use CTR with a randomized IV?

I'm currently reading the chapter of Cryptographic Engineering (Ferguson, Schneier, Kohno 2010) about block cipher modes of operation. They have recommended CBC with random IV instead of CTR due to ...
1
vote
0answers
26 views

MAC-then-encrypt: Using one-time-MAC with randomized CTR

The Coursera cryptography 1 course says: If you want to use MAC-then-encrypt mode then you should either use randomized-CTR or randomized-CBC. And if you use randomized-CTR then one-time-MAC ...
1
vote
1answer
46 views

How to increment the counter value for CTR mode?

I am testing CTR mode on STM32 board. I want to know how the auto increment of counter happens and what is the method to follow if I have to increment the counter manually.
0
votes
1answer
49 views

Security of AES CTR with multiple messages containing the same known plain text

I have this scenario: The same plain text (that is part of an unkown bigger message) is being ecrypted multiple times using AES 128 CTR with a random key, the key is being transfered encrypted using ...
0
votes
0answers
47 views

Attacking AES-CTR mode with known prefix [duplicate]

My question is the following: Consider a 128-bit AES-CTR mode encryption on a plain-text $m$ . The structure of $m$ is constant. First comes a string, let's say : "JustSomeText\" followed by 5 ...
0
votes
2answers
355 views

mode of operation in cryptography

We need to choose a mode of operation for a Telnet like application where the average message size is between 7 and 1024 bytes. What is the best mode of operation in this case? a. CBC b. CFB c. ...
1
vote
1answer
77 views

How is decryption done in AES CTR mode?

Since AES CTR mode uses a unique IV and counter to produce the key to XOR with the plain text to get the ciphertext, the question is so as to how decryption is done. Since AES CTR produces a ...
0
votes
1answer
124 views

Is regular CTR mode vulnerable to any attacks?

Regular plain CTR mode, is it vulnerable to any attack? I plan to write a program to encrypt a drive with ctr mode. Would this be wise? Would AES be better? When I look at this diagram, it looks ...
-1
votes
1answer
204 views

I homebrewed an algorithm. Is it secure?

This is a bit of a cross-posted question which I first asked at StackOverflow, however I was not satisfied with stackoverflow, so I came here for an in depth answer. I, as they say, "rolled my own ...
6
votes
1answer
324 views

Security of a simple AEAD construction

Introduction I want securely communicate with a small 8-bit device which has a very limited program program memory (Arduino Uno - 32K). My goal is to minimize code size and RAM usage. There are ...
6
votes
1answer
132 views

Streaming mode of operation that is more resistant against nonce reuse

Is it possible to create a streaming mode of operation where the reuse of a nonce does not destroy confidentiality? In this question it would be allowed for the streaming mode to leak if ciphertexts ...
1
vote
1answer
55 views

Dangers of using CTR mode for encryption

I know that it is never suggested to use the same key or key/IV pair twice for a stream cipher or for a block cipher operating in CTR mode. Filesystem-level encryption reuses the same key for a file ...
10
votes
3answers
741 views

AES CTR with similar IVs and same key

Let's say there is a piece of software that uses AES CTR to encrypt different messages using the same key but with slightly different IVs. So for example, a 16 byte IV, the 2nd 8 bytes are always ...
1
vote
0answers
31 views

Does extra encryption improve the security of CBC and CTR?

I am learning about cryptography and during my research and reading I had a question. When looking at information leakage and CBC mode, I asked if there is a way to improve this with by using the ...
11
votes
2answers
4k views

Why do we use XTS over CTR for disk encryption?

I'm taking Prof. Boneh's crypto class from Coursera, and am unsure on the requirement for XTS mode for disk encryption. It seems that CTR mode would do exactly what XTS can do, but is simpler to ...
3
votes
1answer
83 views

Multi-target attacks on AES-CTR with a random nonce

128-bit block ciphers are vulnerable to multi-target attacks where the attacker seeks to attack a collection of keys instead of a single key. A simple example: Generate keys $k_1, k_2, ...,k_{2^{40}...
3
votes
0answers
109 views

How does CTR-ESSIV work?

I'm using Wikipedia and Handbook of Applied Cryptography as references. I know that ESSIV generates an initialization vector (IV) by combining a hashed key with the sector number. However, I only see ...
10
votes
1answer
18k views

AES CBC mode or AES CTR mode recommended?

What are the benefits and disadvantages of CBC vs. CTR mode? Which one is more secure?
4
votes
1answer
109 views

Using HMAC as a nonce with AES-CTR encrypt-and-MAC

Suppose I use the following encrypt-and-MAC construction: $E(k_1, k_2, n, m) = E_\text{AES256-CTR}(k_1, n, m) \| \text{HMAC-SHA256}(k_2, m)$, where: $k_1$ and $k_2$ are 256-bit keys $n$ ...
3
votes
1answer
191 views

CTR DRBG dependent on request size?

I am trying to understand the CTR DRBG specification in NIST SP 800-90A. It seems slightly different to a pure stream cipher in that the key and counter are reset after each generate call using the ...
0
votes
1answer
76 views

If PRF is non invertible, why does Ctr-mode work?

I am currently taking Dan Boneh's Cryptography I course online. I have just finished the segment discussing the Cipher Block Chaining and Counter-Mode. I am having difficulty understanding why Ctr-...
2
votes
1answer
213 views

Best practises to generate IV for AES-CTR in this scenario

I'm building a cloud storage application that will store files on my servers. I want these files to be encrypted with AES in CTR mode and the key will be always the same. I'm wondering what would be ...
2
votes
0answers
118 views

Pseudorandom Functions with different input and output lengths

I am working on a problem found in my Cryptography textbook that goes as follows: Let F be a pseudorandom function such that for $k \in \{0,1\}^n$, function $F_k$ maps $l_{in}(n)$-inputs to $l_{...
3
votes
2answers
353 views

Do I need an IV to use AES-CTR as a CSPRNG?

I'm using AES128-CTR for generating pseudo-random values, which is considered secure for up to 1MB (at least from what I've read). I simply encrypt a 128-bit little-endian counter, starting from 0. ...
5
votes
2answers
226 views

Picking a nonce in the context of CCM (CTR with CBC-MAC) mode

After having read the RFC 3610: Counter with CBC-MAC (CCM) and the Wikipedia article on CTR mode, I'm not sure how a nonce should be picked. The RFC says: A nonce N of 15-L octets. Within the ...
3
votes
1answer
89 views

Implementing 5 modes of operation with a hash function

Is it possible to implement any of the 5 modes of operation (ECB, CBC, OFB, CFB, CTR) with a hash function?
1
vote
2answers
290 views

(Re-)Using deterministic IV in CTR mode / How to: deterministic AES

I am aware of the requirement of an IV to be unique in CTR mode (Why must IV/key-pairs not be reused in CTR mode?). However I wonder if I can use an IV depending on the plaintext deterministically. ...
0
votes
1answer
101 views

Explain same encryption time for two files of different sizes

I am encrypting files in a two layered fashion as follows: Inner layer is 128 bit AES-CTR encryption Outer/Second layer is a simple one time padding with a particular key. While testing the ...
4
votes
2answers
379 views

AES-CTR with ephemeral keys vs IV

Let's say that we have a key exchange of some sort, which leaves A and B sharing the long-term secret $S$. Then, A and B want to use AES-CTR for the communication, which leaves us with several ...
4
votes
2answers
217 views

Are all stream-ciphers IND-CPA?

A stream cipher usually generates a stream of pseudo-random bits which get XORed with the plaintext to form the ciphertext. The stream is generated using a given IV / nonce and a secret key. CTR-mode ...
2
votes
1answer
429 views

How many bits of entropy can I expect from /dev/urandom in iOS?

Apple's latest security documentation indicates that it now uses CTR_DRBG for generating pseudo-random numbers (previously Yarrow instead of CTR_DRBG), using "timing variations during boot" and "...
5
votes
5answers
1k views

AES decryption vs encryption speed

Let's consider the CTR mode. For a faster encryption/decryption, is it preferable to use the decryption operation of AES, or its encryption ?
3
votes
2answers
128 views

Does CTR mode yield a PRF?

Can the keystream generated by CTR mode be considered a pseudo-random function? I give more information. Assume $f$ is a PRF. We define a function which takes 2 inputs, the desired length, and an ...
2
votes
1answer
107 views

File encryption with AES CTR mode

I understand that encrypting files in CTR mode is not perfectly safe, because it potentially leaves the files open for cryptanalysis, if the attacker has access to previous versions of the same files. ...
7
votes
3answers
149 views

Why is it good to split a CTR-mode counter into nonce and counter?

When discussing the CTR mode of block ciphers, Wikipedia says the following: Simply adding or XORing the nonce and counter into a single value would completely break the security under a chosen-...
6
votes
1answer
2k views

Reusing keys with AES-CBC

I heard that key/IV pairs must not be reused in AES-CTR, or when using any stream cipher for that matter. Yet the attacks described do not seem to apply to AES-CBC. Is reusing the same key several ...
2
votes
2answers
109 views

Is this commutative encryption protocol secure?

My assumptions are: encryption must be commutative man-in-the-middle is not an issue I would like to implement the following scheme between 2 parties ($A$ and $B$) to exchange a key: Lets $C = P ...
4
votes
2answers
145 views

Turning a 64 bit block cipher into a 128 bit block cipher

There are quite a few block cipher modes of operation that require 128 bits. There are also modes of operation where a higher block size than 128, e.g. a block size of 256 bit would even be practical. ...
1
vote
2answers
125 views

Secure Channel - Encryption and Decryption Keys For A Message

I'm currently reading Cryptography Engineering and in Chapter 7, the topic of secure channel is discussed. The channel described is using CTR for encryption. Below I include images with pseudo-code ...
7
votes
2answers
372 views

What does a stream cipher provide that cannot be obtained with AES CTR mode operation?

I can precompute the key stream for the CTR mode operation and the encryption at that point is similar to a stream cipher. So why are there stream ciphers still used and proposed after RC4? Recently ...
3
votes
2answers
434 views

Why isn't CTR mode (counter mode) used more often?

For the CTR mode, the design is good for parallelization, yes, it seems the benchmark of the program downloaded from crypto++ proves that on an Intel I7 CPU. My question is that as most of CPU on ...
1
vote
1answer
206 views

CTR_DRBG versus OFB_DRBG

As far as I know, in the development of ANSI X9.82, there was consideration of OFB_DRBG, a pseudorandom number generator based on block ciphers like CTR_DRBG, but it appears to have been rejected of ...
3
votes
1answer
135 views

Is it possible to combine true streaming with AEAD?

It seems there is a difference between "streaming" in cryptographic sense (as in CTR) and "streaming" in general programming sense (as in "accept a file larger than RAM from socket and save it on disk"...