salt

Unique text field in MySQL and php

廉价感情. 提交于 2020-01-24 04:35:26
问题 I've created a salt using; md5(rand(0,10000000)); (there is probably a better way?) There doesn't seem to be possible to make a text field unique in MYSQL. So how do I check if the salt has already been used for a previous user? Or should I generate the salt based on the current date/time? as it is impossible for 2 users to register at exactly the same time correct? 回答1: For a salt, uniqueness is more important than length and predictability. You assume the attacker has the salt. A

How to reproduce an SHA256-based HMAC from R in Python 3

允我心安 提交于 2020-01-16 00:46:49
问题 I am trying to reproduce salted sha256 output from R code in Python: library(openssl) res = sha256("test@gmail.com", key = "111") res # [1] "172f052058445afd9fe3afce05bfec573b5bb4c659bfd4cfc69a59d1597a0031" import hashlib, binascii dk = hashlib.pbkdf2_hmac(='sha256', b'test@gmail.com', b'111', 0) binascii.hexlify(dk) # b'494c86307ffb9e9e31c4ec8782af6498e91272c011a316c242d9164d765be257' How can I make output in python match R? 回答1: I can't quite reproduce your issue. The following keys match

OpenSSL - Password vs Salt Purpose

℡╲_俬逩灬. 提交于 2020-01-13 08:33:08
问题 When encrypting a file with OpenSSL, it is possible to use -pass pass:mySillyPassword, where mySillyPassword is the password used in encryption. In addition, it is possible to use a salt, where -salt -s (hex string) is used to specify the salt. Why would someone want to use a password instead of the salt or in conjunction with a salt? Also, I understand just using the -salt command will cause OpenSSL to generate a salt. How is this better than a user-defined salt? If OpenSSL randomly

hash(hash()) vs salted hash

浪子不回头ぞ 提交于 2020-01-13 04:46:29
问题 Since the introduction of Rainbow tables, and using only hashed passwords (e.x: MD5) to stored passwords in database is not the best secured way. When people talk about salted hashes, the always use it in this way hash(password . salt) or even hash(hash(password) . salt) . I don't know why to use salt, and add extra entry for each password to store the salt? Why don't we just use hash(hash(password)) , or even hash(hash(hash(password))) ? Is it more secure to put salt? or just the sense of

How does using a salt make a password more secure if it is stored in the database?

假装没事ソ 提交于 2020-01-12 13:58:29
问题 I am learning Rails, at the moment, but the answer doesn't have to be Rails specific. So, as I understand it, a secure password system works like this: User creates password System encrypts password with an encryption algorithm (say SHA2). Store hash of encrypted password in database. Upon login attempt: User tries to login System creates hash of attempt with same encryption algorithm System compares hash of attempt with hash of password in the database. If match, they get let in. If not,

how to implement sha 512,md5 and salt encryption all for one password [duplicate]

扶醉桌前 提交于 2020-01-11 20:00:12
问题 This question already has answers here : Secure hash and salt for PHP passwords (14 answers) Closed 5 years ago . $pass="test" the above variable contains a password called test.I want to hash this password using sha512 md5 and salt how do i do that as ive found only benifits of salt and sha512,i allready know md5 encryption.please i need the solution as my system is vunerable and please explain it with a code example because im still attached to md5 from what ive understood by your comments

how to implement sha 512,md5 and salt encryption all for one password [duplicate]

不问归期 提交于 2020-01-11 20:00:10
问题 This question already has answers here : Secure hash and salt for PHP passwords (14 answers) Closed 5 years ago . $pass="test" the above variable contains a password called test.I want to hash this password using sha512 md5 and salt how do i do that as ive found only benifits of salt and sha512,i allready know md5 encryption.please i need the solution as my system is vunerable and please explain it with a code example because im still attached to md5 from what ive understood by your comments

[Sql-Server]what data type to use for password salt and hash values and what length?

二次信任 提交于 2020-01-09 19:07:28
问题 I am generating salt and hash values from my passwords by using, string salt = CreateSalt(TxtPassword.Text.Length); string hash = CreatePasswordHash(TxtPassword.Text, salt); private static string CreateSalt(int size) { //Generate a cryptographic random number. RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] buff = new byte[size]; rng.GetBytes(buff); // Return a Base64 string representation of the random number. return Convert.ToBase64String(buff); } private static string

[Sql-Server]what data type to use for password salt and hash values and what length?

拜拜、爱过 提交于 2020-01-09 19:07:16
问题 I am generating salt and hash values from my passwords by using, string salt = CreateSalt(TxtPassword.Text.Length); string hash = CreatePasswordHash(TxtPassword.Text, salt); private static string CreateSalt(int size) { //Generate a cryptographic random number. RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] buff = new byte[size]; rng.GetBytes(buff); // Return a Base64 string representation of the random number. return Convert.ToBase64String(buff); } private static string

Decrypting rfc2898 password

China☆狼群 提交于 2020-01-06 07:14:50
问题 I'm in the middle of development and I need to test my login/password api. Problem is in the database the password is encrypted. I have the following information. key iteration salt Is this enough to recover the password? By the way I can edit these values as well if that will help. 回答1: I think you misunderstood, how a password API works. You cannot reverse a properly hashed password, but you can validate an entered password against the stored hash. To validate the entered password, you need