Questions tagged [salt]

Salt is unique (usually random) data passed into a hash function for password storage to avoid the possible usage of rainbow tables or similar attacks. Salt will not help against dictionary or brute force attacks, as the salt is usually stored together with the hash.

Filter by
Sorted by
Tagged with
1 vote
1 answer
68 views

Salt value in scrypt algorithm

I see there are a lot of questions relating to handling of a salt value but nothing I have seen so far has cleared the following question. When using a KDF such a scrypt, I believe the value of the ...
user avatar
  • 55
0 votes
1 answer
64 views

How safe is my pseudonymization procedure?

I work for an institution where patient data is collected and I am supposed to encrypt it. At the moment I do the following steps (with R): Randomly assigning an ...
user avatar
2 votes
1 answer
96 views

Benefits of hashing a particular seed in a PRNG

This question is linked with this question (stackoverflow) where I asked about a specific implementation detail of Python's random number generator (Mersenne Twister). Here, I have a slightly ...
user avatar
0 votes
1 answer
78 views

XChaCha20 With a Zeroed Nonce?

We know that for ChaCha20 and XChaCha20, the same key can never be used with the same nonce. But let's say I use a random 256-bit key every time... Then the nonce can be whatever because the key is ...
user avatar
  • 421
3 votes
1 answer
93 views

Applications in which you should/shouldn't use a salt with HKDF

rfc5869 has the following to say about the use or lack thereof of salts with HKDF: HKDF is defined to operate with and without random salt. This is done to accommodate applications where a salt value ...
user avatar
1 vote
0 answers
44 views

Can the salt be derived based on the other components of encrypted data?

I'm using python.cryptography's Fernet with PBKDF2 passphrase hashing to encrypt a piece of data (the value) that is stored, encrypted, in a database. The hashed passphrase is not stored in the ...
user avatar
  • 111
1 vote
3 answers
154 views

if i enter a password that's incorrect but that collides with one when hashed, will it let me in?

suppose no salt or pepper is used and passwords are hashed plain, will entering incorrect password that just hashes to the same let me in? i know that one use of salting/peppering techniques is to, ...
user avatar
0 votes
1 answer
48 views

Necessity of PBKDF2 in current Setup?

I have a single password which is random bytes that encrypts a database. Right now I am using an encryption scheme of https://gist.github.com/jbtule/4336842. To summarize, we take our one password, ...
user avatar
0 votes
1 answer
76 views

Should I protect the salt before storing it in a database or use a pepper (secret salt) instead?

If I protected the salt or used a pepper (secret salt) and an attacker got access to the database he can't do a rainbow table attack on a targeted user (a famous or important person). Should I use a ...
user avatar
0 votes
1 answer
67 views

Does my SHA-256 TableSalt algo give away the seed salt?

The Setup I have a table of values for which I need to compute a salted hash for each table-cell value. Furthermore, I need the salt for each table cell to be unique and unpredictable. (I can explain ...
user avatar
5 votes
2 answers
797 views

7-Zip Encryption: Practical Effect of Lacking Salt

A previous discussion on Cryptography StackExchange leads me to understand that 7-Zip does not use salt to derive an encryption key from password to use its AES-256 encryption; that this is a ...
user avatar
0 votes
0 answers
130 views

Adding salt to Blake3 Key derive function

According to the whitepaper, Blake3 can be used as a key derivation function (function key_derive). Currently, as a key ...
user avatar
  • 235
2 votes
2 answers
370 views

Secure AES IV with static salt

I have an (offline) shared secret key (symmetric) which is used to encrypt/decrypt data. Now this data belongs to a specific user which is known on the backend and frontend. My idea was to use the ...
user avatar
1 vote
1 answer
213 views

Do I need a salt for Scrypt if the data is client-side?

I have a web app, in which I am encrypting user data client side. Each client has their own password, which is used to derive an encryption key (via Scrypt) for encrypting their data. Since the data ...
user avatar
  • 421
0 votes
2 answers
446 views

Match bcrypt hash with plaintext

I have a bcrypt hash: $2b$10$kn7yEh2nYiDqDYNY.hjiZOtASBKT9uO4KozbFWDW2XLYnW58nkpq and a list with given plaintext passwords. How can I get the password from the ...
user avatar
  • 17
1 vote
1 answer
120 views

Do you use a salt when encrypting a password or just when hashing a password?

A password is used to connect to a database. This password is kept in a file. This password (therefore) needs to be encrypted. A program to access the aforementioned database needs (of course) the ...
user avatar
0 votes
0 answers
67 views

Best way to derive a MAC key without a salt

It's best to use separate keys for encryption and the MAC. Most implementations tend to derive a larger key and split it in two (e.g. scrypt with an output of 32 + 64 = 96). Alternatively, you can ...
user avatar
  • 1
2 votes
2 answers
226 views

Can I use ChaCha20-Poly1305 as my KDF?

I have two devices that use a PSK. One is embedded and extremely resource confined. I'm already using ChaCha20-Poly1305 so it would be "free" to reuse this. There is no transport encryption ...
user avatar
1 vote
1 answer
250 views

Best practise for encryption in a password manager

I'm trying to make a password manager for Windows installed computers, and after researching the best ways to encrypt the passwords in the database (I'm new to cryptography) I think I've come up with ...
user avatar
1 vote
2 answers
161 views

Static salt for PBKDF2, but unique salt for HKDF?

Hypothetical. Lets say you have an application where you generate a master key from a user password using PBKDF2 (static salt) and then use the master key to derive two passwords keys for an encrypt-...
user avatar
  • 179
0 votes
1 answer
32 views

Which is the better way of generating a salt string?

Using T-SQL as per the snippets below, which method is superior (or is it a tie)? ...
user avatar
-1 votes
1 answer
896 views

Salt length in SHA-512 version of Unix crypt command

SHA-512 crypt specs reports that SHA-512 crypt uses 128bit salt. The FreeBSD/Linux password generation code builds the salt using 16 bytes random data (128bits) and then it translates the random data ...
user avatar
  • 3
0 votes
0 answers
22 views

Is my password database encryption flow secure?

I'm not an expert and I would be very glad if someone could take a look at it and tell if there are any problems with it Things I know/think are problematic using base64 digest + getting the first 32 ...
user avatar
2 votes
1 answer
237 views

Random salt and PBKDF2 key

Suppose I wrote a function $$(salt,IV ) = \text{keyIVGenerator}(passwd)$$ which generates a random salt of size 32-bytes and a random Initialisation Vector (IV) of size 16-bytes. Then, use a Key ...
user avatar
  • 23
1 vote
1 answer
226 views

Using a nonce as a salt for key derivation

I'm currently playing a bit with PyNaCl (python binding to libsodium) and I want to use the secretbox for symmetric encryption between two parties, which means they both must know the (in my case ...
user avatar
3 votes
4 answers
1k views

Could a fixed RSA encryption be used instead of a salt to prevent rainbow table attacks?

It's common to use a salt before hashing a password in order to prevent an attack by rainbow tables. Would it also work to encrypt the password for instance by RSA encryption - by a permanent RSA ...
user avatar
  • 159
2 votes
1 answer
323 views

Difference between server salt and client salt?

Basically I am trying to understand the difference between server salt and client salt. I know that the client salt is used to make encryption harder for hackers, but I can't seem to grasp the concept ...
user avatar
1 vote
1 answer
92 views

Salt: best practice

I'm a complete novice at this and in need of advice. I'm building an app that I've implemented a password encrypted backup feature into. I'm wondering about the best practice for handling the salt. ...
user avatar
  • 11
-1 votes
1 answer
347 views

Is storing salts encrypted a good idea?

I've read that storing password hashes in a database, you can store the salt in plaintext alongside the actual hash with no detriment to security. I was thinking that one could derive a key from the ...
user avatar
  • 119
0 votes
1 answer
282 views

Is AES ECB mode with salt and frame counter still comparatively weak?

Many advice against using AES in ECB mode as it always produces same cipher text for a given plain text. That shortcoming can be addressed by using salt appended to original message so that the ...
user avatar
  • 121
1 vote
0 answers
33 views

AES implementation for non-password multi-document decryption usecase

I am trying to encrypt/decrypt multiple user documents (consider text) in an application. Unlike the use case of passwords where decryption happens once during an API call, in this application during ...
user avatar
11 votes
1 answer
4k views

Why do I need to store the salt for generated hashes?

I am new to crypto and authentication so have been doing reading around this and thought that I had a pretty good understanding of how this works. However when implementing my hashing using ...
user avatar
  • 213
0 votes
2 answers
188 views

KDF and salt storage

Regardless of the KDF I will use, let's imagine that I have to generate two keys: one for authentication and the other for encryption (which will always remain on the device that generates it until ...
user avatar
0 votes
2 answers
122 views

For uniterated SHA-256 of salted password, should the password precede the salt?

This is a follow-up to this question (thanks to answers from @fgrieu and @kelalaka ) about the format of a salt when hashing a salted password. I realize this is pretty much academic, as the proposed ...
user avatar
  • 115
1 vote
2 answers
361 views

What format should a salt be when it is concatenated with the password?

Assume that, in the available environment, it is not possible to use modern password hashing functions (bcrypt, scrypt, Argon2, PBKDF2, etc.), so it is necessary to roll my own stand-in, until they ...
user avatar
  • 115
2 votes
1 answer
567 views

Is it safe to reuse the same nonce for decryption an indefinite amount of times in this context?

I'm creating a password management application and I'm considering using the following procedure to keep passwords safe: Asking the user for raw_password, for ...
user avatar
  • 407
9 votes
3 answers
3k views

Using cryptographically random password as both the password and the salt

This question is theoretical, but will help with my understanding. All of my passwords are securely generated using 64 random letters (both uppercase and lowercase) and numbers. Using the argon2i ...
user avatar
  • 193
2 votes
1 answer
90 views

Choosing between hash functions instead of providing a salt for a password hash

I am working on some programs that require the users to store their passwords in my databases. However, due to the fact that I am not sure whether salt should be stored in databases due to my ...
user avatar
  • 91
1 vote
3 answers
1k views

How to securely store and validate a 4-digit PIN used on a mobile device?

I want to be able to securely (1) create and (2) validate a PIN, typed by a user primarily in a mobile app. There is no 'typical' password, although there is another 2nd factor. The starting point ...
user avatar
0 votes
2 answers
419 views

Cracking hashes: With vs without knowing the salts

Let's assume the following situation: The attacker has extracted 1000 password hashes from a website (vuln.com) along with all their usernames and hashing ...
user avatar
1 vote
3 answers
121 views

Calculate the complexity of HKDF with a 96bit salt and a 128bit key?

I have a 128 bit Pre-Shared Key. I don't want to use it directly. I'd much rather generated a session key with HKDF(PSK, SALT) = SESSIONKEY. I'm however under ...
user avatar
2 votes
1 answer
330 views

ChaCha20-Poly1305: Can my salt/pass for a KDF also be the nonce?

I have a PSK. I don't want to use it directly. I want to pass a "salt"/password into a KDF and get a new key for authenticated encryption with ChaCha20-Poly1305 . I need to give the other side the ...
user avatar
0 votes
2 answers
511 views

Is it safe to use a deterministic salt as an input to KDF (Argon2)?

I'm prototyping an app that uses client-side password hashing in order to hide the "real" account password from a server (the server hashes any recieved password anyway, so no plaintext records in the ...
user avatar
0 votes
2 answers
242 views

Password hash salt

I'm asking this question to have a professional opinion about this, and to check if my assumptions are correct. The question derives from few comments I exchanged on SO: Problem with login I can login ...
user avatar
  • 103
3 votes
1 answer
708 views

BLAKE2: What is the difference between the salt and the personalization?

Libsodium builds their KDF on top of BLAKE2b: BLAKE2B-subkeylen(key=key, message={}, salt=subkey_id || {0}, personal=ctx || {0}) Besides the key, the function ...
user avatar
2 votes
1 answer
926 views

openssl encryption salt length

when i was reading the latest source code of openssl, i found openssl enc has an 8-byte (64-bit) salt length; because the same ...
user avatar
  • 657
2 votes
2 answers
358 views

What is the purpose of salting when integrating PBKDF2 with AES?

I'm a bit new to cryptography and I'm trying to wrap my head around PBKDF2 and AES. As a disclaimer, this is not going to be used in an actual application, I'm just testing things locally as a fun ...
user avatar
0 votes
1 answer
192 views

Add a pepper to a hash: as a string or a buffer, and should I calculate a hash of a peppered plain text?

I'm using a bcryptjs to generate a computationally slow hash function for storing passwords: ...
user avatar
  • 125
0 votes
0 answers
68 views

Static Salt In Argon2 For Converting ECDH Shared Secret Into AES Key

I am using Argon2 to convert an ECDH exchange result into the correct format for AES-256 encryption. However the library that I am using for Argon2 requires a salt. Are there any weaknesses of using a ...
user avatar
  • 593
2 votes
2 answers
71 views

How to protect against brute force attacks in the case of a small dictionary?

Sorry if I'm not using the right terminology, as I'm new to crypto. I want to know the most effective way to protect a database against brute force attacks in the case of a small dictionary. For ...
user avatar