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
1
vote
2 answers
Bouncy Castle AES Encryption - providing input in blocks
I'm using Bouncy Castle library to encrypt some data in my Windows Store App. My EncryptHelper class:
public static class EncryptHelper
{
private const string KEY = "chiaveAES";
private const int SIZE = 16;
private enum CipherMode
{…

Federinik
- 523
- 4
- 20
1
vote
1 answer
One block cipher decryption with an AES and long key
I was given this key in hex String: "140b41b22a29beb4061bda66b6747e14" and requested to decrypt an one block cipher with an AES implementing a ECB.
As we know, the key must be 16 bytes long. But the given key contains elements which correspond to…

mielgosaez
- 11
- 1
1
vote
0 answers
Cipher Feedback mode c++ implementation
HI I am tiring to implement a CFB with DES. I think i am able to encrypt using with CFB but how can I decrypt?? My main issue is CFB code for encrypting using CFB correct ??. Due to the restriction I have, I am unable to use other library.
for…

M.A
- 1,073
- 2
- 15
- 21
1
vote
1 answer
Block Cipher Algorithm
Can somebody provide me a good Block Cipher Algorithm with example. This is required for Data Masking of Strings. Algorithm should be fast and not easily reversible as this will be applied on millions of records.
Either wise you can also suggest…

user2169418
- 11
- 2
1
vote
1 answer
Send IV encrypted or not?
I'm using CBC mode.
I'm thinking of sending the IV encrypted in ECB mode(since it is only a block), instead of sending the "plain" IV.
Will i gain some security?

danieltorres
- 370
- 2
- 12
1
vote
1 answer
AES CTR mode with short messages
Is AES in CTR mode safe to use when encrypting short messages (less than a block size)? An example would be encrypting SSN or credit card numbers. I have seen conflicting information concerning this so I would just like clarification.
Thank you

crawfish
- 853
- 4
- 11
- 14
1
vote
1 answer
IllegalBLockSizeException when decrypting
I wrote an encrypt and a decrypt function. The encrypt works fine, but I always get IllegalBlockSizeException in the decrypt.
public static String aes_encrypt (String text, String key)
{
SecretKey skey = new SecretKeySpec(key.getBytes(),…

One Two Three
- 22,327
- 24
- 73
- 114
1
vote
1 answer
Passing gzencoded data to mcrypt_encrypt, can't unzip after decryption
To keep this short, are there known issues when passing results of gzencode (or other non-text data) to mcrypt_encrypt functions?
Details:
Basically I have an issue where encryption/decryption is working for plain text but I get errors unzipping if…

Fraggle
- 8,607
- 7
- 54
- 86
0
votes
1 answer
Is there a protocol that uses MD5 Hashing?
I have a program that I am reverse engineering for learning purposes about protocols (and to sharpen my assembly skills). I have reversed the whole protocol, and know where encryption takes place and all. The program uses an CBC(chain block…

user954753
- 309
- 1
- 3
- 14
0
votes
1 answer
What is cipher option in pyinstaller spec file and how to use it?
Note: I am using pycharm and have virtual environment. Python version is 3.11.1. PyInstaller version is 5.7.0. OS is Mac Ventura 13.2.
I want to build one-folder bundle using pyinstaller with encryption. I am thinking of writing .spec file.
I read…

체라치에
- 173
- 1
- 16
0
votes
1 answer
Cipher.doFinal() returning part of decrypted string for a long string
I am experiencing an issue when decrypting a string using sunjce :
javax.crypto.Cipher cipher =
javax.crypto.Cipher.getInstance("AES/GCM/NoPadding", new BouncyCastleProvider());
GCMParameterSpec spec = new…

P basak
- 4,874
- 11
- 40
- 63
0
votes
0 answers
Breaking Flawed One Time Pad
I have a cyphered OTP message and the sender made a mistake and used a key that was shorter than a message.
The plaintext was not padded before encryption so length of c equals length of m.
How could I calculate the length of the OTP key (k) used…
0
votes
1 answer
What [uint64 x1 = *(const uint64*)in;] and [uint64 x2 = *(((const uint64*)in)+1);] mean in Kuznyechik source code (from VeraCrypt ciphers)
There are two elements in Kuznyechik source code from VeraCrypt source code: https://github.com/veracrypt/VeraCrypt/blob/master/src/Crypto/kuznyechik.c#L2271-L2272
uint64 x1 = *(const uint64*)in;
uint64 x2 = *(((const uint64*)in)+1);
They are…

phantomcraft
- 125
- 4
0
votes
0 answers
What would be faster: Spliting a 64-bit word into 16 nibbles and entering them in S-Boxes or using an entire 64-bit word directly as an entry?
This question is related to cryptography, but I believe I'm asking in right place (not in Crypto Stackexchange).
Kuznyechik block cipher splits a 64-bit word into 16 nibbles (4-bits) and use them as entries in its S-Boxes, each nibble is mixed with…

phantomcraft
- 125
- 4
0
votes
0 answers
Why do we only take the 1st and last bits together for SBox substitution?
Today, in class we were discussing about how s-box is used in feistal ciphers. Our sir went on to say that for s-box substitution, we take the 1st and last bits as one part and the remaining bits as another, following which we find the matching 4…

jeremy
- 59
- 7