Luis Casillas
  • Member for 5 years, 9 months
  • Last seen this week
When do I need to use CBC and HMAC?
5 votes

It sounds like you have one big misconception in your question: Also, I hear about CBC-MAC which can provide integrity and confidentiality. Which one is better CBC-MAC or CBC with HMAC? The first ...

View answer
Is it safe to use a timestamp to build a nonce?
1 votes

The first point I'd make is: why can't you just use TLS? (Or if it's a non-interactive protocol, why can't you use ECIES?) Nonce-96-bit = Timestamp-Milliseconds-64bit combined_with CsRandom-Number-...

View answer
Using AWS KMS to manage secret keys
4 votes

AWS is complicated, and most of the details are not in scope for this site. We will need to store AWS credentials in plain text on servers (our server as well as client's) to call KMS, how is it ...

View answer
How do I check if the output of my CFB TEA encryption algorithm is correct?
1 votes

I would recommend modularizing the implementation into these components: A generic interface abstracting the concept of a block cipher. A generic CFB mode implementation, that instead of hardcoding ...

View answer
Is an AEAD the recommended method to add encryption + HMAC to a protocol?
4 votes

I think you're a bit unclear about the factoring and abstraction layers here. A correctly designed AES + HMAC construction is AEAD. This is because AEAD is about what interface and contract the ...

View answer
Should number of iterations of PBKDF2 stay secret?
1 votes

Let's say I encrypt my passwords with PBKDF2 and store it somewhere. It's not clear here whether you literally mean to encrypt some passwords with a key derived from a master password (as a password ...

View answer
Recommended minimum entropy for online passwords in 2018
2 votes

I think you're missing one major factor in your list: Is the password being used to derive an encryption key that's never in the possession of another party, or is is only used to authenticate the ...

View answer
Is it safe to use a random numbers instead of a counter in ChaCha20?
7 votes

Besides the IV, ChaCha20 takes a random number and a counter as input. No it doesn't (sec. 2.4): The inputs to ChaCha20 are: A 256-bit key A 32-bit initial counter. This can be set to any number, ...

View answer
The logic of preferring PBKDF2 over iterative SHA2
8 votes

I think you are overstating the complexity of PBKDF2, and also, not matching it feature-wise with your alternative. Let's dispatch the latter first: as gammatester's comment mentioned, PBKDF2 ...

View answer
Best way, how to convert 32-byte Keccak hashes to positive numbers up to maximum?
5 votes

Your "32-byte Keccak hash" doesn't look like a canonical, binary Keccak output, but rather appears to be encoded with some Base64 variant—to me it appears to be the MIME version. Your comments on the ...

View answer
Why is release of unverified plaintext so Bad?
1 votes

Isn't unverified plaintext released just nonsense? You're looking at it from a human perspective, and assuming that gibberish is harmless because there's a human in the loop that would spot it. But ...

View answer
If a probabilistic encryption algorithm is used, how does decryption return the correct message?
0 votes

Because probabilistic encryption produces ciphertexts that are longer than the plaintext, and this additional length contains information that allows for deterministic recovery of the plaintext. Your ...

View answer
In cryptography is there such as thing as disguising unencrypted text?
0 votes

It seems to me that decryption must always be reliant on being able to recognise that you've managed to reach the unencrypted text. The 21st century answer to this question is that cryptographers ...

View answer
Reusing IV in AES for encrypting file
3 votes

You aren't telling us exactly what you plan to do, but plenty enough that we can tell you: no, just no. The first mistake you're making is that you're talking about "files" in a way that's worrisome ...

View answer
What is the advantage of a symmetric encryption system over an asymmetric encryption system?
5 votes

Speed Some people say a symmetric one is faster than an asymmetric one, but is this that significant? Yes. It is significant enough that most asymmetric systems are actually hybrid—they present ...

View answer
Can I prove my app uses randomness right way?
1 votes

A real-life example that's relevant is Diceware, where users generate strong, uniform random passphrases by rolling dice and looking the results up in a numbered wordlist. Diceware's virtue is ...

View answer
What would the implications be of a single randomly discovered SHA-256 collision?
6 votes

It's possible that more collisions would be found right away. The reason is that SHA-256 is an iterative hash function—it works by absorbing messages block by block into a finite state. Since the ...

View answer
MAC attacks without knowing the key
2 votes

One way to try tackling simpler problems like this is by writing them out as equations and doing algebra on them. In this case, let's take this statement from your comment with the answer: The ...

View answer
Protecting my message without encryption
2 votes

I think this is a question that comes down to understanding the basic Alice, Bob and Eve diagram from cryptography textbooks, like this one from Wikimedia that I've chosen because of its license and ...

View answer
Should text be hashed before being used as an encryption key?
2 votes

Let's say I have an API that provides an encryption wrapper around another API. I give the consuming programmer the option of either passing a string or byte array as an encryption key. Encrypting ...

View answer
Allow everyone to decrypt a message, but don't allow anyone to encrypt it
Accepted answer
2 votes

This is a scenario where your description would be much improved if you explicitly considered the following questions, which you should always ask in cryptography: Who are the "honest" parties? (See ...

View answer
Why is the IV passed in the clear when it can be easily encrypted?
0 votes

There isn't anything really wrong with the earlier answers, but I think they missing the chance to articulate a more basic justification of the security of passing IVs in the clear. Which is this: ...

View answer
Is HMAC a suitable substitute for HKDF?
4 votes

HKDF is itself built from HMAC, so your question strikes me as a false dilemma. If you have HMAC, HKDF Is just a handful of HMAC calls; you could just implement your own. Yes, I know that "don'...

View answer
cryptographic function that changes with time?
0 votes

If values of $t$ are never repeated for multiple encryptions, then the already standard concepts of nonce-based encryption and pseudorandom function family (PRF) can be used to construct such an ...

View answer
Public Key Encryption, how do you handle not trusting the middle man?
Accepted answer
2 votes

With public/private key encryption you must trust the central authority correct? Not quite. The honest parties must have an authenticated (but not necessarily confidential) channel to obtain each ...

View answer
Why don't block ciphers consist of a simple XOR operation with key like Stream ciphers?
5 votes

If the construction of stream ciphers is already secure why does the construction of block cipher involve pseudo permutations and complex operations that makes block ciphers less faster? Because ...

View answer
Salt passwords with the username?
Accepted answer
5 votes

However, since usernames are unique [...] But the same user is supposed to get a fresh salt when they change their password. Salts are not supposed to be bound to usernames as you suggest; they're ...

View answer
Why SHA-256 (or any other) is too fast for passwords but "slow" for collisions to be found?
Accepted answer
7 votes

I suspect the answer is related to the fact that passwords are, in general, small. No, actually, the answer is related to the fact that passwords are, in general, predictable. Meaning that out of ...

View answer
Do storage encryption systems care about size of data?
Accepted answer
6 votes

It's common for encryption algorithm specs to specify a hard limit of how much data you should encrypt with the same key. For example, consider the AES-XTS encryption algorithm, which was designed ...

View answer
Security of using sha(secret + rand)
Accepted answer
3 votes

Using HMAC is more principled and flexible here, because HMAC with a random secret key is a pseudorandom function, while sha256(secret + nonsecret) isn't. In your case where the non-secret is a ...

View answer
1 2 3
4
5
10