A block cipher is a keyed bijective function (also pseudo-random permutation). If your question is not directly related to programming, check if the question fits better on https://crypto.stackexchange.com/ or https://security.stackexchange.com/
Questions tagged [block-cipher]
136 questions
35
votes
11 answers
Symmetric Bijective Algorithm for Integers
I need an algorithm that can do a one-to-one mapping (ie. no collision) of a 32-bit signed integer onto another 32-bit signed integer.
My real concern is enough entropy so that the output of the function appears to be random. Basically I am looking…

Emre Yazici
- 10,136
- 6
- 48
- 55
17
votes
4 answers
How to detect block cipher mode
How to detect if a message was crypt by CBC or ECB mode?
I have made a function who encrypt in AES 128 CBC or ECB randomly, and I do hamming between clear text and cipher text, but seams not correlated to cipher mode.
How can I detect the block…

Xantra
- 223
- 1
- 3
- 8
15
votes
2 answers
What is the default IV when encrypting with aes_256_cbc cipher?
I've generated a random 256 bit symmetric key, in a file, to use for encrypting some data using the OpenSSL command line which I need to decrypt later programmatically using the OpenSSL library. I'm not having success, and I think the problem might…

Steve
- 6,334
- 4
- 39
- 67
12
votes
2 answers
Source and importance of nonce / IV for protocol using AES-GCM
I am making a protocol that uses packets (i.e., not a stream) encrypted with AES. I've decided on using GCM (based off CTR) because it provides integrated authentication and is part of the NSA's Suite B. The AES keys are negotiated using ECDH,…

Hut8
- 6,080
- 4
- 42
- 59
8
votes
1 answer
Anyone with a C#, Delphi or FreePascal implementation of the PRESENT Ultra-Lightweight Block Cipher encryption?
A short while ago a paper got published on PRESENT: An Ultra-Lightweight Block Cipher by Andrey Bogdanov et al becoming ISO standard 29192-2:2012.
Is there anyone that has a C#, Delphi or FreePascal implementation with unit tests?
This was asked…

Gustavo Carreno
- 9,499
- 13
- 45
- 76
8
votes
3 answers
CTR mode use of Initial Vector(IV)
from what I know, CTR mode doesn't use an Initial Vector.
It just takes a counter, encrypts it with a given key and then XOR's the result with the plaintext in order to get the ciphertext.
Other block cipher modes like CBC before doing the…

Antonys
- 83
- 1
- 1
- 3
6
votes
1 answer
Is this AES encryption secure enough?
I got this code from http://www.ravenblast.com/index.php/blog/android-password-text-encryption/ and, although it works, I have a growing suspicion it's not secure enough. There isn't any initialization vector which seems to be necessary according…

user2083242
- 63
- 1
- 5
5
votes
1 answer
How does libgcrypt increment the counter for CTR mode?
I have a file encrypted with AES-256 using libgcrypt's CTR mode implementation.
I want to be able to decrypt the file in parts (e.g. decrypting blocks 5-10 out of 20 blocks without decrypting the whole file).
I know that by using CTR mode, I should…

E1adi
- 77
- 4
5
votes
2 answers
How to encrypt files with AES256-GCM in golang?
AES256-GCM could be implemented in go as https://gist.github.com/cannium/c167a19030f2a3c6adbb5a5174bea3ff
However, Seal method of interface cipher.AEAD has signature:
Seal(dst, nonce, plaintext, additionalData []byte) []byte
So for very large…

can.
- 2,098
- 8
- 29
- 42
5
votes
1 answer
ECB, CFB, OFB cipher modes in Openssl
I know that when I use CBC mode with Openssl, I can give as an input which is a multiple of a block size. But how about other modes? ECB, CFB, OFB? I saw a doc but its not all clear to me. Should I call them in a loop?
Lets say, ECB. It encrypts 64…

ivy
- 1,445
- 3
- 15
- 20
5
votes
1 answer
encrypt-decrypt single block with AES and Crypto++
I need to encrypt single block of AES. I cant use any modes like CBC and other. Every example what i have seen use streaming modes.
EDIT:
ok, i did it in the next manner, but i really dislike this try.
void dec(const byte *key, const byte* xblock,…

Yola
- 18,496
- 11
- 65
- 106
4
votes
1 answer
What exactly does the "NoPadding" parameter do in the Cipher class?
Java's Cipher class supports the transformations listed there. Among them are several NoPadding variants:
AES/CBC/NoPadding (128)
AES/ECB/NoPadding (128)
AES/GCM/NoPadding (128)
DES/CBC/NoPadding (56)
DES/ECB/NoPadding (56)
DESede/CBC/NoPadding…

Hey
- 1,701
- 5
- 23
- 43
4
votes
1 answer
Midori128 incorrect ciphertext
I have a project in which I must implement a variety of Security Protocols for my Arduino Uno R3, such as Present, Misty, Prince, and so on. At the moment I am attempting to implement Midori128. I managed to get Midiori64 to work properly, but for…

Omar-UniMA
- 41
- 4
4
votes
2 answers
Using Coldfusion's Encrypt function to encrypt a hex block and return a block-length result
My company is working on a project that will put card readers in the field. The readers use DUKPT TripleDES encryption, so we will need to develop software that will decrypt the card data on our servers.
I have just started to scratch the surface on…

GumbyG
- 488
- 4
- 8
4
votes
1 answer
Crypto++ symmetric algorithms and authenticated block modes combinations
I've implemented a C++ wrapper library for Crypto++ v5.6.2 and have a question about combinations of symmetric algorithms (e. g. Blowfish) and block modes (e. g. GCM).
I am able to encrypt and decrypt data via Blowfish/EAX, but I can't achieve the…

Florian Wolters
- 3,820
- 5
- 35
- 55