Reputation
2,110
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
5 11
Impact
~45k people reached

Apr
27
comment What does the TLS 1.2 client finished message contain?
I'd say: the data to encrypt is 12 bytes, as Dave says, i.e. the truncated output of the PRF-SHA256 output. But GCM being used, means the ciphertext will be longer and include the nonce (12 bytes) and the tag (16 bytes), as to RFC5288. The tag also authenticates the TLS header data (type and length).
Apr
27
comment How to use OpenSSL command line utility to encrypt data with encrypted key from public key?
Also: sizes are stored how? binary, Little-Endian or Big-Endian? All in one continuguous binary file? Length of iv seems superfluous given that we're using AES (so 16 is the only value). Example files (also of PK, see other comment) please!
Apr
27
comment How to use OpenSSL command line utility to encrypt data with encrypted key from public key?
What's the format of the public key? Could you post one? It's quite doable (using some shell utilities) but the format of the public key matters for the openssl options and possibilities.
Apr
9
comment Encrypt-then-HMAC implementation - am I doing it right?
But is it C# (and portably so?). I think that would matter to the OP.
Mar
20
comment Finding d given everything else in RSA
@jamie the API might not accept negative numbers, in which case you might need the extended Euclidean algorithm instead
Mar
20
comment Finding d given everything else in RSA
@fgrieu True. I'll delete the comment.
Mar
20
comment Finding d given everything else in RSA
@Jamie take exponent equal to $-1$, modulus to $\phi(n)$.
Mar
20
comment Signing MD5 hashes with RSA?
Collisions and factoring attacks on the hash value etc.
Mar
20
comment I am trying to understand how AES works
Did you look at youtube.com/watch?v=mlzxpkdXP58, e.g.?
Mar
20
comment Signing MD5 hashes with RSA?
Don't use MD5 anymore. Just use SHA256, and a standard algorithm for signing (with padding!), e.g. PKCS1.5 will do fine for this case.
Mar
4
comment Solving for a One-time pad cipher help ; crib dragging doesnt work (no surprise)
@Thrall it's hex encoded, so that's why you only see 16 characters. ASCII bytes xored with random bytes, encoded as hex (2 characters per byte).
Feb
9
comment Need CryptDeriveKey AES implementation in C#
Microsoft does document their "CryptDeriveKey" function. Check msdn. It's their own invention, not standard based.
Feb
9
comment Linear cryptanalysis complete key guessing
You guess the other bits as well, after determining the subkeys.
Feb
6
comment How to break Universal Re-Encryption algorithm?
Possibly relevant crypto.stackexchange.com/a/18954/553
Dec
23
comment SHA256 message bytes
Indeed. It's a key expansion in a way: the message is the key for the cipher (at the core of SHA26) and is expanded from 16 32-bit words to 64 32-bit words. The state is then handled as the message (with a xor feed forward for non-reversibility)
Dec
17
comment Factorizing N to derive D
long is also not big enough. Use gmp or some other bignum library, if you want C. Of course Python will do this OK, as it has bignums built in.
Dec
12
comment Message exchange with textbook RSA
I agree, but it's just a conceptual exercise, I suppose. It might be part of some algebra course without crypto focus, e.g., so padding, replay attacks etc. are not relevant, but just the application of some algebra theory that was just treated, e.g. I didn;t want to get things in that the OP wouldn't know about.
Dec
11
comment Why does GPG ciphertext length differ with fixed plaintext length?
The base64 difference is expected. If we input $n$ bytes, we have $4(n/3 + 1)$ output bytes if $n$ is not evenly divided by 3, and $4(n/3)$ otherwise. So a difference of 4 between 389 (remainder 2) and 387 (no remainder) is clear, and cannot be helped. That is how base64 encoding works.
Dec
11
comment Why does GPG ciphertext length differ with fixed plaintext length?
Can you give the complete gpg command ? Giving the string on the command line interprets it as a filename, so you must do something else. All details can matter.
Dec
11
comment Why does GPG ciphertext length differ with fixed plaintext length?
Just a remark: base64 is not encryption, just a standard way to transfer/display binary data as text data.