Padding has two primary uses in cryptography, ensuring messages are the proper length necessary for certain ciphers (e.g., block ciphers) or to provide assurances not built into the core cipher (e.g., semantic security)

learn more… | top users | synonyms (1)

3
votes
1answer
69 views

How does RIPEMD160 pad the message?

For RIPEMD hashing algorithm on hardware I am not exactly getting how padding works So as per my understanding padding will work like explained below: For ripemd 160 message should be multiple of ...
1
vote
0answers
19 views

If you use an AES key just once, do you need to use IV, and/or pad the message? [duplicate]

I am developing an application that is going to use AES encryption. Since it is going to use a different key for every message encrypted... Would it be secure to use a constant IV? (i.e null bytes) ...
4
votes
1answer
71 views

Should I be concerned about padding oracle attacks if the lifespan of my key is ~1 minute?

I'm using 4096-bit RSA to encrypt a 256-bit AES key generated client-side. The RSA ciphertext is then sent to the server, and the server decrypts the RSA ciphertext to acquire the AES key. ...
3
votes
1answer
183 views

Homemade Randomized RSA

Considering the following encryption scheme where RSA is used to encrypt a plaintext m and then we choose a random r and compute: $$A = r + m^e \bmod N$$ and $$B = r^e \bmod N$$ So the ciphertext is ...
4
votes
2answers
90 views

Is it safe to use cipher block sizing instead of padding?

I'm using this kind of technique instead of padding of cipher buffer (here goes pseudo-code): ...
2
votes
1answer
27 views

Is PKCS#7 padding generated with a pseudo-random-number generator okay?

Let's take this PHP code. We use libsodium and libsodium-php. You have $text, $senderPrivateKey, ...
6
votes
1answer
67 views

What are the relative merits of padding algorithms pkcs7, iso7816, and x923?

I am assuming none of these padding algorithms are "the best"... But what are the advantages and disadvantages of using them? PKCS7 is certainly the most commonly used one, but I am interested in ...
4
votes
0answers
81 views

Adding parameters to sponge's capacity

Is it safe to XOR parameters like domain, length of the message or block counter into sponge's capacity or that gives attacker control over capacity? For example NORX XORs domain into capacity. Does ...
2
votes
1answer
28 views

NORX duplex padding

MonkeyDuplex constructions defined by Keccak authors has padding in every duplex block. Why only last duplex block is padded in NORX? Is it because NORX has domain separation, or simply because ...
1
vote
0answers
20 views

Does OEAP padding limit the size of my modulous to the size fo the hash function?

im looking at wiki at the moment as how to use oeap padding and it appears, help me out if im wrong as G(r) - expands r to the size of the padded message, I am then limited by the size of my hash ...
3
votes
1answer
50 views

How does padding oracle attack work with bytes larger than possible length?

I am trying to understand how the POODLE attack would actually be implemented. In the original security advisory from Möller, Duong and Kotowicz [POODLE 14] the following example is presented: ...
2
votes
1answer
96 views

Signing/verification between Java and the OpenSSL

I'm trying to sign/verify data between a C application and a Java application. In java for now I was using the built-in JCE provider with SHA256withRSA as ...
0
votes
0answers
45 views

Symmetric encryption with compression for MySQL DB data

I would like to compress data before encrypting and storing it in a MySQL DB to reduce especially bandwith requirements (compression reduces bandwith by 70-80%). At present, all is handled by a ...
8
votes
1answer
895 views

Why is it OK for secretbox to leak the message length?

Most block cipher implementations expect users to pad so that the message matches the cipher block size. I understand the purpose of the padding is to make the input match the cipher block size. It ...
1
vote
1answer
40 views

Is there a standard prefix random padding scheme?

Is there a standardized padding scheme which is prefix instead of postfix and that uses random bytes except for the first byte which would be the length of the padding?
0
votes
1answer
47 views

PKCS5 having no padding

I am using the javax.crypto.Cipher in Java to do AES/CBC/PKCS5Padding encryption. What I am observing is that, if you try to encrypt a Plaintext with no padding, PKCS5 adds another entire block just ...
1
vote
1answer
135 views

Computing the padding of MD5

So I'm reading this question to learn more about length extension attack, and I want to make sure I understand the basics of padding. It says in the post that given the hash and the length of the ...
1
vote
1answer
68 views

Which ECB ciphertext stealing scheme is this?

I am stuck with identifying ciphertext stealing method with the following properties: mode of operation is ECB; recommended padding scheme for this application is PKCS#7, but apparently it is not ...
1
vote
2answers
71 views

PKCS#7 message content

I am using a vendor library that signs a text producing a PKCS#7 message. I'm not sure of the content of this message. Does a pkcs#7 message have to contain the signed message, the certificate, the ...
3
votes
1answer
129 views

Why not use OAEP for signatures?

There seems to be a distinct lack of implementations of RSA signatures using OAEP to pad the digest. Other than the old, funky, padding schemes, it's PSS all the way. PSS seems to have the whiff of ...
1
vote
0answers
347 views

Decrypt using OpenSSL produces packing errors

I am receiving an encrypted file and it's key from a partner. The Key has itself been encrypted using our Digital Certificate Public Key, though I don't know exactly how. The partner has instructed me ...
1
vote
1answer
35 views

Variable length variable output encryption with out any padding?

I would like to know if there is any encryption algorithm with variable input variable output with out any padding? For example if I give 16(17,18,67,117,..any size) bit plaintext, my ciphertext is ...
0
votes
0answers
29 views

In HMAC-MD5 Implementation, why “i_key_pad” and “o_key_pad” if They Are Public and Constant? [duplicate]

Please Consider: English is My Second Language This Wikipedia article on HMACs shows a part of a HMAC-MD5 implementation making use of i_key_pad and ...
2
votes
1answer
109 views

RSA - PKCS#1 padding - overall correction of algorithm

From PKCS#1, page 24: After we create the EM byte string and convert it to an integer, we then encrypt that integer with RSAEP (page 10) to get the ciphertext (as an integer). My question arrives ...
3
votes
1answer
80 views

Is RSA vulnerable to the padding oracle attack?

I know that AES in combination with CBC mode is vulnerable against the Padding Oracle Attack. RSA also uses some kind of padding, hence can this attack be apply to RSA encrypted messages too?
3
votes
0answers
41 views

IND-CCA1 RSA padding?

I've found a way to complete a task which I'd solve with passwords or by sending keys over the wire (otherwise) by using RSA's homomorphic property. I'm restricted to RSA (any padding; for hardware ...
12
votes
2answers
167 views

Attacking RSA signature verification that ignores padding

I am looking at a RSA signature verification that is quite obviously flawed and am wondering if there's a way to exploit that flaw in practice. Signature is generated using RSA with PKCS 1.5 padding, ...
4
votes
1answer
83 views

AES storing the length within the encrypted data versus storing it outside

I need to strip off padding after decrypting AES(CBC)-encrypted data (I have control over encryption and data transmission), so have looked at adding the length of the original data to the payload ...
2
votes
1answer
66 views

Using AES for smaller blocks in a Feistel network

I was wondering how decryption would work for FPE in the case of cycled Feistel ciphers. I understand that simply reiterating through the networks with reversed key order will generate the ciphertext ...
3
votes
1answer
153 views

Why don't use random padding in RSA?

Consider the following scenario: Sender S sends a message to receiver R. He uses a hybrid encryption scheme with RSA as key-encapsulation algorithm and AES-256-CTR (4byte-counter) and SHA256-HMAC. ...
8
votes
1answer
815 views

If RSA is only used to encrypt symmetric keys which are random, what's wrong with textbook RSA?

IND-CPA is used to protect against frequency analysis AFAICT. But if RSA is only used to encrypt symmetric keys (AFAICT) then what's wrong with using only textbook RSA because random keys are very ...
2
votes
3answers
114 views

Why not put MAC in fixed position and cover padding for MAC-then-encrypt?

The biggest problem with using MtE with a mode where it's known to be secure (CBC) is with the padding, where you can't retrieve the authentication until you know where it is by looking at the padding ...
1
vote
1answer
114 views

poodle padding multiple blocks?

I'm quite new to the topic and read a bit about poodle and padding oracle. I quite understand the "regular" padding oracle attack, substituting the last byte of block(n-1) to determine the last byte ...
0
votes
0answers
42 views

What is sLHAE (stateful length-hiding authenticated encryption)?

Can somebody please explaint me how does sLHAE works in TLS? I met this term in some TLS papers and struggled to understand how it works, specifically the "length-hiding" part.As to my understanding ...
1
vote
2answers
77 views

Is a padding oracle attack possible if data is only encrypted internally on a server (e.g. for storage)?

I read something about the padding oracle attack when analysing the use of an AES-encryption of data in a database and was "scared" it could be a serious issue. But after investigating a bit further, ...
1
vote
2answers
175 views

Why is this a fix to Bleichenbacher's attack?

Looking at the excellent explaination of the attack here: Can you explain Bleichenbacher's CCA attack on PKCS#1 v1.5? I have one additional question: It says that: ""To prevent this attack, SSL ...
1
vote
1answer
93 views

RSA padding confusion attacks

Server A produces signed messages on request. You can tell server A what type of RSA padding to use in the signature (either RSASSA-PKCS1v1_5 or RSASSA-PSS). Either way, the message will be signed ...
1
vote
2answers
228 views

Why can the last block contain a full block of padding in CBC Encryption?

I'm trying to understand the SSL Poodle Attack and I'm wondering why the last block of a CBC Record can be full of padding? Wouldn't that mean that the useful data was already a multiple of the key ...
0
votes
1answer
924 views

SHA-512 Length Field - What is it?

If I am using SHA-512 on a message and need to determine the padding field and length field, how do I determine the length field? I think I understand the padding, but not the length field. For ...
0
votes
2answers
248 views

How does RSA padding work exactly?

I've read everywhere online and people say plain text RSA is very unsafe. To make it safe you pad it but no examples are shown anywhere on how to do it. It's explained that random data is added to the ...
-1
votes
2answers
286 views

Remove padding (CBC) from decrypted text [closed]

I have a bit problem with padding. Everything goes fine when I encrypt the text BUT when I decrypt I see some extra characters. Sometime's one character sometimes more and I dont know how to remove ...
0
votes
1answer
82 views

Asymmetric sign in public enviroment

I have RTS game, where all players run game and server just relays messages. Game can generate and store text file on player pc. I want to allow some players to be moderators, so I need to sign or ...
1
vote
1answer
272 views

OpenSSL RSA same plaintext but different ciphertext

how OpenSSL RSA work ? I generate public (n,e) and private key (n,d) then I encypted a file by : ...
6
votes
2answers
2k views

Which attacks are possible against raw/textbook RSA?

The PKCS#1 standard defines multiple padding schemes for signature generation/verification (EMSA-PSS and EMSA-PKCS1-v1_5), and encryption/decryption (EME-OAEP and the less safe EME-PKCS1-v1_5). ...
0
votes
0answers
80 views

NRPAD and FPAD padding schemes (Korean Seed?)

I've got an API spec that specifies NRPAD and FPAD as possible padding schemes. I see these being used together with the Korean SEED algorithm. The SEED specification however is void of any padding ...
1
vote
1answer
211 views

How to encrypt letters less than block n using Hill Cipher

I am learning about Hill Cipher and know that it is a block cipher where each block of n letters (considered as an $n$-component vector) is multiplied by an invertible $n \times n$ matrix, again ...
1
vote
2answers
291 views

Random vs. Fixed Paddings

Is there any consensus (i.e. are there any research results) on the benefits and drawbacks of various padding schemes? Generally there seem to be two kinds of them: random paddings, like ISO10126 ...
3
votes
2answers
125 views

Why verify padding at all?

Whenever a ciphertext is decrypted using a block-cypher, we need to remove the padding. There are different ways to add padding, but they usually set the last byte of the last block to the number of ...
2
votes
1answer
140 views

Bit padding instead of PKCS#5 padding

Padding oracle attacks are a huge nuisance when using CBC mode encryption without authentication. Wouldn't all those padding oracle attacks be avoided if we'd just use bit padding instead? Or is does ...
2
votes
1answer
76 views

Is HMAC padding the same as bcrypt?

I have been watching Christof Paar on his YouTube lectures also I used bcrypt to store two passwords with salts and I find that I have a few questions. I am interested in what bcrypt does to the ...