2022 Developer Survey is open! Take survey.

Questions tagged [padding]

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)

Filter by
Sorted by
Tagged with
2 votes
0 answers
40 views

Padding mechanism used in onion routing

I would like to get a correct understanding of the padding mechanism used in onion routing. The following is taken from the original paper of onion routing[https://www.onion-router.net/Publications/IH-...
user avatar
1 vote
2 answers
93 views

AES output lengths are not always a multiple of 16

I have a C# solution that encrypts a bunch of small data chunks using AES. ...
user avatar
2 votes
1 answer
86 views

What would be the disadvantages of very large block sizes in block ciphers?

Let's suppose someone creates a block cipher with 8192-bytes of the block size (65536-bits) or maybe 16384-bytes of the block size (131072-bits). What would be its disadvantages over a block cipher ...
user avatar
1 vote
1 answer
40 views

On the correctness of the padding example of RFC 5246

The PKCS#7 padding is defined in rfc5652#section-6.3 Some content-encryption algorithms assume the input length is a multiple of k octets, where k is greater than one. For such algorithms, the input ...
user avatar
  • 43.1k
0 votes
1 answer
64 views

What's the difference between "padding" and "checksum" in cryptography?

In cryptography, padding is any of a number of distinct practices which all include adding data to the beginning, middle, or end of a message prior to encryption. In classical cryptography, padding ...
user avatar
  • 205
2 votes
0 answers
47 views

Prevent Bleichenbacher by adjusting Padding

I got the following question and I really don‘t know how to answer them. My I ask you for your input? Do you think, that the following adjusted Padding will prevent the classic Bleichenbacher attack <...
user avatar
  • 21
1 vote
1 answer
94 views

Security of PKCS7 padding

I just designed my own padding function and came up with a potential problem that could harm the security of encryption. After I fixed that flaw, I found out that the PKCS7 standard padding should be ...
user avatar
  • 37
1 vote
2 answers
108 views

OPENSSL: What is the difference of enc command and cms' enc command?

I found something strange while checking the inside of the envelope data. I had plain text "plaintextplant" - length is $15$ (include lf(0x0A))`. I made a ...
user avatar
1 vote
1 answer
57 views

Revealing original message length having random padding

If I have a message that has a fixed unknown length $L$, and we add to it's TLS encryption a random sized padding $0\leq n \leq N$ so the sent message if $L+n$. I'm also able to make the target re-...
user avatar
  • 143
2 votes
1 answer
453 views

What is the main problem with zero padding for AES key?

I am trying to understand the logic behind some basic principles of AES key padding. Why do we use different kinds of AES key padding schemes instead of the simplest zero-padding? Take AES-128 for ...
user avatar
1 vote
0 answers
42 views

How to reproduce seeds in Random Number Generator like WELL, KISS etc

I am curious about Padding the seeds of Random Number Generator. (I am sure that terminology, padding the seeds, is not correct. If someone knows the proper word, please let me know :) ) What is ...
user avatar
  • 123
3 votes
2 answers
68 views

How are the instantiations of RSAES-OAEP and SHA*WithRSAEncryption different in practice?

For the spare-time project I had been working on, I'm evaluating the PKCS#1 padded RSA schemes for implementation. For PKCS#1 v1.5, encryption doesn't seem to require a hash function, and the ...
user avatar
  • 6,551
-1 votes
1 answer
106 views

Padding and the MD5 algorithm

In MD5, if M=100, how can we perform padding on it and how many blocks are needed in each round? These are general questions for understanding padding and rounds.
user avatar
2 votes
1 answer
151 views

What is the padding block actually in merkle damgård?

I'm studying up on Merkle Damgård construction for hashing and having some trouble understanding the "padding block", at the end of the message blocks. When you look it up it says that in ...
user avatar
2 votes
1 answer
445 views

What is the 2021 Padding Recommendation for RSA?

What is the current, year 2021, padding Recommendation for RSA? PCKS1? 7? 11? OAEP?
user avatar
  • 187
11 votes
2 answers
2k views

Random data CBC padding scheme?

When using AES in CBC mode, padding is required when the last plaintext block has not the length required by the cipher. Let's say $k$ mode bytes would be required to fill the block. My idea was to ...
user avatar
2 votes
1 answer
62 views

Why does Merkle-Damgård hashing involve putting the padding at the end instead of at the start?

Pretty much the title. We have that $x$ is a prefix of $PAD(x)$, instead of being a suffix - was that an arbitrary choice or is there a reason for it? Thank you.
user avatar
0 votes
0 answers
247 views

Attack a RSA padding scheme that appends zeros

Imagine we implement RSA padding such that a number of byte zeros are appended to the message until its length is equal to 100 (i.e. 800 bits). Also, let's assume that the public exponent $e$ is equal ...
user avatar
  • 1
3 votes
1 answer
54 views

Is there any advantage using this kind of ROM-based randomized hashing in digital signatures?

The said randomized hasing is actually a sort of padding, and it goes like this: ...
user avatar
  • 6,551
0 votes
1 answer
49 views

Small values with non-uniform distribution encoded as large values with uniform distribution

Given a non-uniformly distributed set of 32-bit values (for example), is there a way to reversibly encode each one as a 128-bit value (for example) where they'd be approximately uniformly distributed ...
user avatar
0 votes
1 answer
79 views

Generating a SHA256 pkcs1v1.5 Blind RSA Signature using Chaum's Blind Signature Scheme

I am a noob to cryptography in the sense that I have very less understanding as to how RSA encryption schemes work in practice. However I do understand the theoretical foundations of RSA cryptography ...
user avatar
0 votes
0 answers
34 views

How can you tell if padding was used? [duplicate]

Let's say you have an encryption algorithm that uses PKCS5 padding. You input 'secret message', which is 14 characters long, but for some reason or another the algorithm needs it to be 16 characters ...
user avatar
  • 1
3 votes
2 answers
333 views

Is it ever OK to to sign RSA messages with padding random bytes?

If a message is padded with cryptographically secure random bytes, is there any reason why this would be less secure than the standard signature padding schemes (PKCS1 v1.5 and PSS)? To give context ...
user avatar
0 votes
0 answers
60 views

Using a bit sequence of zeros followed by one byte in Keccak

For what purpose it is not right to use a bit sequence of 2000+ zeros followed by one byte in Keccak? Is there a possible application of such input for Keccak? If yes, after which transformation?
user avatar
2 votes
2 answers
619 views

Actual RSA encryption & decryption of strings?

$K_{pub} = (n, e)$ $K_{pvt} = d$ Then $E_{K_{pub}}(x) \equiv x^e \mod n$ Practically, when RSA is used to encrypt strings, what is the $x$ here? You cannot take it byte by byte because $\mod n$ will ...
user avatar
  • 1,678
5 votes
0 answers
71 views

Security implications of using the low-order bits for Merkle–Damgård message length

According to RFC 1321 § 3.2 (MD5), the length of the message ($b$) is encoded as $b \bmod 2^{64}$: ...
user avatar
  • 12.9k
0 votes
1 answer
483 views

RSA PKCS#1 OAEP Padding Schema - padding 0 for first octet?

In this document, it shows the EM will have one zero octet padding prefixed. ...
user avatar
  • 21
1 vote
1 answer
257 views

PKCS#7 Signed Data contains always different signature

I am wondering why CMS (PKCS#7) Signed Data contains always a different signature of the original data when the SHA256withRSA signature algorithm is used. (using ...
user avatar
0 votes
1 answer
262 views

How to correctly pad by PKCS#7 for AES?

I want to implement AES-CBC mode with PKCS#7 padding, along with a way to validate a correct padding given the ciphertext. My initial understanding was that for an input of size ...
user avatar
  • 199
2 votes
1 answer
572 views

PKCS#7 CMS - Message digest calculation process

i'm studying RFC 5652 in order to know exactly how to encode/decode PKCS#7 ASN.1 data. I don't understand how one can create a signature when the field "signedAttrs" is present: The result ...
user avatar
  • 23
3 votes
1 answer
121 views

SHA3 hexadecimal paddig odd length string

Section B2 of FIPS-202 specification describes the Hexadecimal Form of Padding Bits which is basically the translation of the bit padding 0110*1. However at the beginning they suppose that the message ...
user avatar
  • 33
0 votes
1 answer
136 views

Which Cryptographic Standard ensures cryptographic agility and good adapotion

Which Cryptographic Message Standards are recommended to ensure cryptographic agility in the future and good adapotion trough different programming languages (.NET and Go)? (PublicKey with ...
user avatar
  • 141
0 votes
1 answer
372 views

How to alter text that was encrypted with AES CBC using PKCSPadding7

Assuming, I had a ciphertext along with its decrypted plain text result but not the IV or the Secret Key. (keep in mind that the text was encrypted with AES/CBC/PKCSPadding7). How would I go about ...
user avatar
3 votes
1 answer
742 views

AES Padding (Nullbytes vs PKCS7)

I currently implement the AES(128,192,256)(ECB,CBC). Does the type of padding affect security? I just want to fill the blocks with null bytes.
user avatar
0 votes
0 answers
87 views

Can I and How Decrypt this Online

Although I had a security course in school a long time ago, I am effectively new to cryptography. I have an encrypted text, the encryption key of 44 characters, the encryption method, (Fernet, which ...
user avatar
  • 101
1 vote
3 answers
2k views

What's the difference between digest algorithm and signing algorithm?

I'm reading rfc5652, there are different references of the two algorithm identifiers. For example in this ASN.1 structure: ...
user avatar
  • 141
2 votes
1 answer
558 views

best padding scheme for RSA

So i came across three padding scheme for RSA: PKCS1, PSS and OAEP. My intention here is to encrypt a file using AES key. then, encrypt the AES key with the RSA key and save the encrypted AES key ...
user avatar
0 votes
1 answer
63 views

Implementation of a decryption mixnet, and problems with the size of the key

I've been studying decryption mixnets, in the context of e-voting and stealth networks. Let's describe it in a very simplified way. The concept is pretty simple. A message M is forwarded through ...
user avatar
1 vote
1 answer
745 views

How RSA-OAEP decrypt a Symmetric Key message?

In an RSA-OAEP encrypted symmetric Key (AES for example) message. The message is then decrypted by the other party when R is a Random Number That other party doesn't know about. so How it can retrieve ...
user avatar
  • 373
3 votes
1 answer
521 views

AES-256, CBC, plaintext length is multiple of block size: Does PKCS #7 padding weaken the encryption?

Of course, padding is superfluous when AES with CBC is used if you know that the plaintext length is a multiple of the block size. But does the padding precipitate a weakness in the encryption? ...
user avatar
  • 133
1 vote
0 answers
51 views

Should you pad messages encrypted with stream ciphers?

Should you pad messages encrypted with stream ciphers? The obvious answer seems to be yes, right? It obviously leaks the exact length of the plaintext. Consider a situation where an adversary knows a ...
user avatar
  • 23
-1 votes
1 answer
65 views

How to recover RSA messages if they are padded with spaces?

I have a message m="hunter". Let's say we pad it with 2 spaces from the left making the final message as ...
user avatar
0 votes
0 answers
50 views

RSA PADDING WITH e=3 [duplicate]

I have a ciphertext which has been padded with spaces from left the message is 31 bytes long and e = 3 how can I recover the message with python code .
user avatar
3 votes
1 answer
314 views

Signing a GPG Public Key

I am trying to manually create a GPG Public Key (see here). I am able to generate a GPG Public Key with a correct hash, but fail to RSA-sign that hash in a way that is accepted by the GPG CLI. For the ...
user avatar
  • 193
0 votes
2 answers
713 views

Find IV and the key ? AES with CFB or OFB

I have a question about the AES-128 and AES-256 encryption method. I need to encrypt 64-bit size data in and out. I want to encrypt them with AES. So I turned to AES-OFB or AES-CFB because these ...
user avatar
  • 1
0 votes
1 answer
140 views

How to find m so that RSA cipher end with '\x00'+SpesificString , if we freely input the plaintext?

I have an RSA encryption with public key $(3,n)$ with 2048 bits modulus $n$. I want to find the value of the plaintext $m$ so that the ciphertext (in bytes representation) value ends with ...
user avatar
1 vote
1 answer
786 views

Does AES-CBC always use PKCS#7?

I need to add AES decryption with a 256 bit key to our software, and of course I won't do it myself; rather, I chose a library that works fine for our needs. It supports various modes of operation, ...
user avatar
  • 175
-1 votes
1 answer
267 views

Which is more secure, AES CTR or OTP with generate key?

My idea of the OTP is to generate from 50 letters (5 words, each 10 letters) a new pad of 2000 random letters, then attach user email to the pad end (to make it unique). The keywords and the pad will ...
user avatar
  • 13
2 votes
1 answer
322 views

RSA encryption secure mode, plaintext length limit vs. key length

I have two questions about RSA encryption to confirm: Assume use RSA 2048-bit key pair, what is the secure encryption mode? Are ECB / OAEPWithSHA-256AndMGF1Padding and ECB / OAEPWithSHA-...
user avatar
  • 447
1 vote
1 answer
160 views

RSA Encryption Time with Different Block Sizes

I was working on encrypting a few files on my computer and I was using OAEP for padding with RSA. I noticed that it was taking a long time to encrypt some of my files with a small block size, so I ...
user avatar
  • 11

1
2 3 4 5 6