sha512

Nodejs crypto vs python hashlib

北城余情 提交于 2019-12-07 12:21:00
问题 I'm trying to make a python function and a nodejs function compute the same hash. However, it seems like the binary that is outputted is different between nodejs crypto and python hashlib. The python I'm using is: hash = hashlib.sha512() hash.update(salt) hash.update(password.encode('utf8')) hash.digest() The node/coffeescript is: crypto.createHash('sha512').update(salt, 'binary').update(password, 'utf8').digest() These lines should produce the same result, but for some reason they don't.

Storing a SHA512 Password Hash in Database

爱⌒轻易说出口 提交于 2019-12-06 21:55:23
问题 In my ASP.NET web app I'm hashing my user passwords with SHA512. Despite much SO'ing and Googling I'm unclear how I should be storing them in the database (SQL2005) - the code below shows the basics of how I'm creating the hash as a string and I'm currently inserting it into the database into a Char(88) column as that seems to be the length created consistently Is holding it as a String the best way to do it, if so will it always be 88 chars on a SHA512 (as I have seen some bizarre stuff on

HMAC SHA512 using CommonCrypto in Swift 3.1 [duplicate]

筅森魡賤 提交于 2019-12-06 14:58:34
问题 This question already has answers here : CommonHMAC in Swift (10 answers) Closed 2 years ago . I'm trying to encrypt data to send to the API. The API requires the data to be sent as hmac_sha512 encrypted hash. I've found various examples of how it possibly could have been done for sha1 and others (not sha512 ) and also in older versions of Swift. None of the examples that I tried work for swift 3.1 Any help in the right direction will be appreciated. Edit: In PHP, I successfully send it using

How do a use a SecureString to create a SHA1 or SHA512 Hash?

若如初见. 提交于 2019-12-06 06:33:48
I would like to use a SecureString varible within VB.NET and convert that to a SHA1 or SHA512 hash. How would I securely convert the SecureString to the Byte array that HashAlgorithm.ComputeHash will accept? What about that, if we avoid the only used String instance (output) and replace it with a character array. This would enable us to wipe this array after use: public static String SecureStringToMD5( SecureString password ) { int passwordLength = password.Length; char[] passwordChars = new char[passwordLength]; // Copy the password from SecureString to our char array IntPtr passwortPointer =

SHA 512 crypt output written with Python code is different from mkpasswd

喜你入骨 提交于 2019-12-06 06:29:10
问题 Running mkpasswd -m sha-512 -S salt1234 password results in the following: $6$salt1234$Zr07alHmuONZlfKILiGKKULQZaBG6Qmf5smHCNH35KnciTapZ7dItwaCv5SKZ1xH9ydG59SCgkdtsTqVWGhk81 I have this snippet of Python code that I thought would output the same, but isn't: import hashlib, base64 print(base64.b64encode(hashlib.sha512('password' + 'salt1234').digest())) It instead results in: nOkBUt6l7zlKAfjtk1EfB0TmckXfDiA4FPLcpywOLORZ1PWQK4+PZVEiT4+9rFjqR3xnaruZBiRjDGcDpxxTig== Not sure what I am doing wrong

.net vs Objective c SHA-512 mismatch

好久不见. 提交于 2019-12-06 02:33:44
问题 I am trying to write function for creating sha512 string in objective from .net function which is public static string GetSHA512(string strPlain) { UnicodeEncoding UE = new UnicodeEncoding(); byte[] HashValue = null; byte[] MessageBytes = UE.GetBytes(strPlain); System.Security.Cryptography.SHA512Managed SHhash = new System.Security.Cryptography.SHA512Managed(); string strHex = string.Empty; HashValue = SHhash.ComputeHash(MessageBytes); foreach (byte b in HashValue) { strHex += String.Format("

SHA512 not the same in CryptoJS and Closure

两盒软妹~` 提交于 2019-12-05 21:50:45
I have some troubles with a simple crypto-challenge. I want to do following: getting a url-encoded and base64-encoded value do url-decoding do base64-decoding hash with Sha512 When working with CryptoJS, i use following code: var parameter = "Akuwnm2318kwioasdjlnmn"; var urlDecoded = decodeURIComponent(parameter); var base64Decoded = CryptoJS.enc.Base64.parse(urlDecoded); var hashed = CryptoJS.SHA512(base64Decoded).toString(CryptoJS.enc.Base64); //hashed = "UxupkI5+dkhUorQ+K3+Tqct1WNUkj3I6N76g82CbNQ0EAH/nWjqi9CW5Qec1vq/qakNIYeXeqiAPOVAVkzf9mA=="

PHP Openssl decrypt an AES Mysql Encryption

百般思念 提交于 2019-12-05 04:32:26
So i'm just doing some basic data encryption on my mysql tables. I followed the guidelines found here https://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html#function_aes-encrypt But i'm running into an issue. While i know i can just use aes_decrypt in the mysql query to decrypt the data. I want to also have the ability for php to do so itself. I've gotten this part working. If MySQL does the very basic AES_ENCRYPTION like so INSERT INTO tablename (dataset) VALUES (AES_ENCRYPT('testvalue','mysecretphrase')) I'm able to decrypt this with php like so openssl_decrypt(base64_encode($dR[

Storing a SHA512 Password Hash in Database

最后都变了- 提交于 2019-12-05 02:52:43
In my ASP.NET web app I'm hashing my user passwords with SHA512. Despite much SO'ing and Googling I'm unclear how I should be storing them in the database (SQL2005) - the code below shows the basics of how I'm creating the hash as a string and I'm currently inserting it into the database into a Char(88) column as that seems to be the length created consistently Is holding it as a String the best way to do it, if so will it always be 88 chars on a SHA512 (as I have seen some bizarre stuff on Google)? Dim byteInput As Byte() = Encoding.UTF8.GetBytes(sSalt & sInput) Dim hash As HashAlgorithm =

How to hash a string to SHA512 in Swift?

百般思念 提交于 2019-12-04 23:06:01
问题 I am building a social media application and I would like some help encoding a password string to SHA512 in Swift. I found the CryptoSwift library on GitHub but I am having a hard time loading it into my Swift project and linking it to my project files. Does anyone know how to accomplish this relatively easily? Thanks in advance, Kyle 回答1: Solution for Swift 3 : extension String { func sha512() -> String { let data = self.data(using: .utf8)! var digest = [UInt8](repeating: 0, count: Int(CC