Questions tagged [ecb]

ECB (Electronic Code Book) is a degenerate mode of operation for block ciphers.

Electronic Codebook mode (ECB) is a mode of operation for block ciphers that involves dividing the message into blocks and encrypting each block independently.

ECB mode encryption

It is the simplest mode of operation, but is considered very weak. Identical plaintext blocks are encrypted into identical ciphertext blocks, which makes it easy for an attacker to circumvent its security. As such, it is not recommended to be used for any secure system. Instead, a secure mode such as Cipher-Block Chaining (CBC) or Counter (CTR) mode should be chosen.

Why ECB is not secure?

ECB is not semantically secure because identical blocks of plaintext will be encrypted to the same ciphertext block. This vulnerability helps the attacker to find out plaintext patterns.

141 questions
0
votes
1 answer

How to allow decryption with the wrong key to complete without throwing a BadPaddingException?

I'm in need of a simple AES cryptosystem in ECB. I have one working at the moment in the sense that given the same key twice in a row, it will correctly encrypt and decrypt a message. However, if I use two different keys for encrypting/decrypting,…
TheElysian
  • 159
  • 1
  • 1
  • 7
0
votes
0 answers

How to get Block Cipher ECB key given cipher text and plaintext

This seems like a really simple problem. I just can't seem to figure it out. A message was encrypted using a Block Cipher that seems to follow an Electronic Codebook method. I know that they took it in blocks of 3 characters at a time. I know what…
0
votes
1 answer

Can I use AES128/ECB/PKCS7 encryption with Java 1.4

I have a string holding some parameters that needs to be encrypted in AES-128 in ECB mode with PKCS7 padding, and then Base-64 encoded. My code base is Java 1.4. Is this possible with Java 1.4 api ?
jdoyle0116
  • 83
  • 2
  • 12
0
votes
0 answers

Incorrect results while decrypting AES-128-ECB text

I have a piece of Base64 text, which I know was encrypted in AES-128-ECB mode, and even know the key (YELLOW SUBMARINE, 16 bytes). I'm using the following code to decrypt it. textbox1 contains cyphertext; textbox2 contains the key private void…
0
votes
1 answer

Remove bytes from object (python decrypt blowfish ECB)

I am modifying a python script. There is a function that decode a string, but it gives me the error that the data passed to decrypt isn't a multiple of 8. I tried to add it the bytes it needs, but after i don't know how to remove them before return…
Vitto
  • 361
  • 3
  • 17
0
votes
0 answers

CCCrypt crashes with EXC_BAD_ACCESS

I am encrypting a video and sometimes I get a crash with CCCrypt. This is my encryption method, can anyone shed any light on why it might crash? (The process is run in an NSOperation in a queue). The crash occurs on the CCCryptorStatus cryptStatus =…
Darren
  • 10,182
  • 20
  • 95
  • 162
0
votes
1 answer

How do I decrypt an Adobe Triple Des ECB mode encrypted password?

So as you may have heard. The adobe user database of 130 million was leaked recently. I want to find out what password I used for the adobe account I created to make sure that I'm not using it anywhere else. But how do I decrypt the Triple DES ECB…
0
votes
2 answers

DES Encryption on Blackberry gone wrong

I have an application developed on BlackBerry JDE 5.0.0 that encrypts a String using DES algorithm with ECB mode. After the encryption, the result is encoded by base64 encoding. But whenever I compare the result that i get from my encryption method…
0
votes
2 answers

Which Cipher in Ruby OpenSSL API is equivalent to DES_ecb2_encrypt()?

Which Cipher in Ruby's OpenSSL API is equivalent to the OpenSSL C function DES_ecb2_encrypt()? I see the following ciphers: irb(main):003:0> OpenSSL::Cipher.ciphers => ["AES-128-CBC", "AES-128-CFB", "AES-128-CFB1", "AES-128-CFB8", "AES-128-ECB",…
Tilo
  • 33,354
  • 5
  • 79
  • 106
0
votes
2 answers

Electronic code book (ECB) cipher chaining

I need to implement RSA algorithm using ECB (Electronic Code Book) as a school assignment. I know that ECB is bad and I should never use such thing in real life, but I have no other option here (we will eventually turn it to CBC and then move…
-1
votes
1 answer

Exception has occurred: ValueError Data must be aligned to block boundary in ECB mode

The code below throws an error "Exception has occurred: ValueError Data must be aligned to block boundary in ECB mode" when ran. This is an encrypted json file and no matter what I do it throws this error. Any ideas? Im really just trying to make or…
-1
votes
1 answer

TypeError: argument of type 'int' is not iterable in AES Algorithm using Python

I want to encrypt a text using AES algorithm. The code is given below.But when I run this code, I got the following error: Traceback (most recent call last): File "/home/a/AES/aes.py", line 159, in cipher = AES.new(key.encode('utf8'),…
Abin Benny
  • 125
  • 2
  • 10
-1
votes
1 answer

3DES EDE ECB Enryption - the c++ output differ from JAVA default mode output

I am using 3des-ede-ebc encryption from openssl library.. the result cipher is encoded using base64. But the result cipher of encryption (both base564 and Hex encode) is different than the result from any online encryption site for same. Eg: for…
-1
votes
1 answer

C# simple encryption works but the decryption doesn't work?

Hope someone can help. I have followed a very simple tutorial on how to make an encryption/decryption tool. The encryption works perfectly but the decryption doesn't work. The encryption works in that when i open the encrypted file in a text…
-1
votes
1 answer

Triple DES encoding-java.security.InvalidKeyException: key size must be 128 or 192 bits

I am using below code to implement Triple DES encoding with ECB and PKSC5 Padding.The secret key which i am using is stored in a file named key in raw folder.I am getting below exception- java.security.InvalidKeyException: key size must be 128 or…
Bhuvi
  • 51
  • 2
  • 13
1 2 3
9
10