Questions tagged [sha256]

sha256 stands for Secure Hash Algorithm-256. It is a hash function computed with 32-bit words. It was designed by the US National Security Agency (NSA). It is used to authenticate Debian GNU/Linux software packages, in the DKIM message signing standard and many other applications.

sha256 stands for Secure Hash Algorithm-256. It is a hash functions computed with 32-bit words. It is one of the function in SHA-2 library. SHA-2 is a set of cryptographic hash functions (SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256) published in 2001 by the NIST as a U.S. Federal Information Processing Standard (FIPS).

It was designed by US National Security Agency (NSA). It is used to authenticate Debian GNU/Linux software packages, in the DKIM message signing standard and many other applications.

1952 questions
15
votes
3 answers

get SHA256 hash of public key

I have a certificate mycert.pem . I got the public key of the certificate by command: openssl x509 -pubkey -noout -in mycert.pem > pubkey.pem How can I get the SHA256 hash of the public key?
Leem
  • 17,220
  • 36
  • 109
  • 159
15
votes
2 answers

Using crypto node.js Library, unable to create SHA-256 Hashes multiple times in rapid succession

I am creating a hash of an auto-incrementing number. I have created two example loops of how I'm trying to achieve this. When #1 is is run, the first hash is logged to the console and on the second iteration through the loop, the following error is…
agm1984
  • 15,500
  • 6
  • 89
  • 113
15
votes
4 answers

Python stop multiple process when one returns a result?

I am trying to write a simple proof-of-work nonce-finder in python. def proof_of_work(b, nBytes): nonce = 0 # while the first nBytes of hash(b + nonce) are not 0 while sha256(b + uint2bytes(nonce))[:nBytes] != bytes(nBytes): …
mesafria
  • 311
  • 2
  • 10
15
votes
5 answers

How to encrypt data using RSA, with SHA-256 as hash function and MGF1 as mask generating function?

I was doing some experiments with cryptography. Now I have the public key of receiver and i want to encrypt some data and pass to the receiver. I want to use RSAES-OAEP algorithm. with SHA-256 as hash function and MGF1 as mask generation…
jithin
  • 637
  • 2
  • 14
  • 26
14
votes
3 answers

Does Git use SHA-256 to calculate commit hashes?

Does the current version of git (2.30.0) already use SHA256 to calculate commit hashes by default? If not, how can SHA-256 be enabled for a new git repository and how can be checked whether a certain git repository uses SHA-256 or SHA-1 for its…
matthias_buehlmann
  • 4,641
  • 6
  • 34
  • 76
14
votes
4 answers

One way hash (not for crypto/security), use SHA256 (not MD5, SHA-1)?

On a new system, we require a one-way-hash to compute a digital signature from binary input (e.g., a kilobyte of text, or larger text-and-binary files). The need is similar to how Scons (build system) hashes command-lines and source files, and how…
charley
  • 5,913
  • 1
  • 33
  • 58
14
votes
3 answers

HmacSHA256 in WebAssembly compiled with Emscripten

I'm trying to implement JWT token (encoding only) in WebAssembly, the goal is to have a very light weight wasm module. As a web developer my C knowledge is limited. For now I've implemented the following function (ported from JS) to encode url-safe…
Roni Gadot
  • 437
  • 2
  • 19
  • 30
14
votes
1 answer

Excel formula-based function for SHA256 / SHA512 hashing without VBA or macros

It's the year 2017 and anybody who needs to use hashes should avoid 'broken' ones such as MD5, if security is important. Has anybody found or created a way to do more secure SHA256 or SHA512 hashing in Excel, without using VBA or macros? A…
JKVeganAbroad
  • 169
  • 1
  • 1
  • 11
14
votes
2 answers

Generate SHA256 in c++

I need to generate SHA256 of some data. I found this example is a very good one. Now my question is Can I generate a sha256 by using my own key. EDIT: First of all, sorry for wrong question. I don't mean that to change the key used to generate…
Nelson T Joseph
  • 2,683
  • 8
  • 39
  • 56
14
votes
2 answers

Difference between signing with SHA256 vs. signing with RSA-SHA256

I play with digital signatures using node.js. For test purpose, I created a digital signature of some XML data, first using only SHA256, then using RSA-SHA256. The thing that puzzles me is that both methods of signing create exactly the same…
Arim
  • 161
  • 1
  • 1
  • 6
13
votes
1 answer

How to verify a signed file in python

Background I have signed a file using openssl SHA256 and a private key as follows: with subprocess.Popen( # Pipe the signature to openssl to convert it from raw binary encoding to base64 encoding. # This will prevent any potential…
ErikusMaximus
  • 1,150
  • 3
  • 13
  • 28
13
votes
1 answer

How to use common crypto and/or calculate sha256 in swift 2 & 3

I am trying to make hash a password value according to sha256. I already search this but there is no info about swift 2. This solution did not worked for me func sha256(data:String) -> String { let data =…
mesopotamia
  • 393
  • 1
  • 5
  • 19
13
votes
2 answers

What is better? Password_hash vs. SHA256 vs. SHA1 vs. md5

What is better with salt for password storage? MD5: $hash = md5($password . $salt); Password_hash: $hash = password_hash($password, PASSWORD_DEFAULT, $salt); SHA1: $result = sha1($salt.$string);
Joci93
  • 803
  • 3
  • 10
  • 24
12
votes
2 answers

Why base64 a sha1/sha256 hash?

can anybody tell me why amazon want a base64 of the hmac-sha1/sha256 hash? http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide/HMACAuth.html I know that base64 is to represent binary date in ascii but sha1/sha256 is already ascii…
tuna
  • 931
  • 2
  • 10
  • 28
12
votes
5 answers

HMAC SHA256 hex digest of a string in Erlang, how?

I am trying to interact with third party real time Web messaging System created and maintained by Pusher.com. Now, i cannot send anything through the API unless i produce an HMAC SHA256 hex digest of my data. A sample source code written in ruby…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86