scrypt

How to use scrypt to generate hash for password and salt in Python

戏子无情 提交于 2019-12-04 20:30:00
问题 I would like to use scrypt to create a hash for my users' passwords and salts. I have found two references, but there are things I don't understand about them. They use the scrypt encrypt and decrypt functions. One encrypts a random string and the other encrypts the salt (which looks wrong since only the password and not the salt is used for decryption). It looks like the decrypt function is being used to validate the password/salt as a side effect of the decryption. Based on the little I

What's the is maximum length of scrypt output?

只愿长相守 提交于 2019-12-04 02:25:15
I'd like to store an scrypt -hashed password in a database. What is the maximum length I can expect? Gili According to https://github.com/wg/scrypt the output format is $s0$params$salt$key where: s0 denotes version 0 of the format, with 128-bit salt and 256-bit derived key. params is a 32-bit hex integer containing log2(N) (16 bits), r (8 bits), and p (8 bits). salt is the base64-encoded salt. key is the base64-encoded derived key. According to https://stackoverflow.com/a/13378842/14731 the length of a base64-encoded string is where n denotes the number of bytes being encoded. Let's break this

sCrypt implementation in JavaScript? [closed]

徘徊边缘 提交于 2019-12-04 01:33:39
Someone asked about a JavaScript implementation of bCrypt a while back and appears to have written their own code to handle the implementation. Does anyone have an implementation of sCrypt in JavaScript? Bob Aman The answer linked above points to a project that no longer exists. This project, however, is still around: https://github.com/tonyg/js-scrypt twobits If you are talking about tenebrix, the choice of scrypt was better then bcrypt for the goals set. I so far have only found one incomplete javascript implementation of scrypt and hit on this page while searching. https://github.com

Hash password in Swift application

早过忘川 提交于 2019-12-03 20:36:57
This question was migrated from Information Security Stack Exchange because it can be answered on Stack Overflow. Migrated 4 years ago . Learn more . For security purposes I will encrypt some data, including the user password in my application. My colleagues have chosen scrypt hashing algorithm, for a 64 bytes length, with a fixed seed, then converted to hex. Hashing " A12345678Z " leads to: 25fac84a1cc3a8f6706848d1016cfe7e9d3631691306dcacae68c11c7b54f0bf89e7a7fc51f7fcc19671775acb21c8d928c4c96bb66d915925de58b8b36ab251 Seed is “ HeanpyftAkWilfUd ”. On server, they are using this implementation

Example code for Scrypt and Cryptsharp

ぃ、小莉子 提交于 2019-12-03 13:00:51
I have searched all over Google and I can't find a code sample of Scrypt usage (for hashing a password) using the Cryptsharp library. Can you please provide a sample for hashing the password? It's only a single call so I'll walk you through the parameters: key : this is your password, use UTF-8 encoding (without byte order mark) to encode your password into a byte array; salt : a string of secure random bytes stored with the result of the scrypt function, 16 bytes should be ample; cost : the given suggestion is 262144, but you may want to increase that value if your server can handle the

How to use scrypt to generate hash for password and salt in Python

你说的曾经没有我的故事 提交于 2019-12-03 12:52:06
I would like to use scrypt to create a hash for my users' passwords and salts. I have found two references , but there are things I don't understand about them. They use the scrypt encrypt and decrypt functions. One encrypts a random string and the other encrypts the salt (which looks wrong since only the password and not the salt is used for decryption). It looks like the decrypt function is being used to validate the password/salt as a side effect of the decryption. Based on the little I understand, what I want is a key derivation function (KDF) rather than encryption/decryption and that the

.NET implementation of scrypt

一曲冷凌霜 提交于 2019-12-02 14:21:42
I've read about scrypt and some of its advantages over the bcrypt hashing algorithm in certain circumstances. Anyhow, it seems scrypt isn't as widely used yet. Has anyone seen so far a .NET implementation of it (favored in C#)? Finally I found an implementation of scrypt in C# in the CryptSharp library . The library is open source and uses the ISC license . CryptSharp Version History 1.2.0 January 23, 2011: The SCrypt KDF is now supported as CryptSharp.Utility.SCrypt. Added djb's Salsa20, required by SCrypt. There's a new implementation of SCrypt for .NET here: https://github.com/replicon

Bouncy Castle scrypt implementation

点点圈 提交于 2019-11-30 22:59:24
问题 I'm currently implementing password hashing using scrypt . I have already found a nice scrypt implementation on GitHub. To my surprise I have also discovered a scrypt implementation in the Bouncy Castle library. The class is not documented, Wikipedia didn't mention Bouncy Castle as scrypt implementation provider and I had real trouble finding any code examples of someone using Bouncy Castles scrypt, so this looks somehow suspicious to me. On the other hand if I had to choose between a GitHubs

What are optimal scrypt work factors?

我与影子孤独终老i 提交于 2019-11-27 09:00:50
问题 I'm using a Java scrypt library for password storage. It calls for an N , r and p value when I encrypt things, which its documentation refers to as "CPU cost", "memory cost" and "parallelization cost" parameters. Only problem is, I don't actually know what they specifically mean, or what good values would be for them; perhaps they correspond somehow to the -t, -m and -M switches on Colin Percival's original app? Does anyone have any suggestions for this? The library itself lists N = 16384, r