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
57
votes
5 answers

How to use sha256 in php5.3.0

I'm using sha256 to encrypt the password. I can save the sha256 encrypted password in mysql. But i can't login with the same clause. Insert code:
SUN Jiangong
  • 5,242
  • 16
  • 57
  • 76
54
votes
3 answers

Is there a limit on the message size for SHA-256?

When hashing a string, like a password, with SHA-256, is there a limit to the length of the string I am hashing? For example, is it only "safe" to hash strings that are smaller than 64 characters?
Jackson
  • 9,188
  • 6
  • 52
  • 77
51
votes
2 answers

Will a SHA256 hash always have 64 characters?

I'm setting up my database to receive hashed passwords and not accept plain text. Would I go something like this? create table User( username varchar(20) not null, password varchar(64) not null, );
Sergio Tapia
  • 40,006
  • 76
  • 183
  • 254
51
votes
5 answers

Best practice for hashing passwords - SHA256 or SHA512?

I am currently using SHA256 with a salt to hash my passwords. Is it better to continue using SHA256 or should I change to SHA512?
econner
  • 707
  • 2
  • 8
  • 14
45
votes
9 answers

Hashing passwords with MD5 or sha-256 C#

I'm writing a register form for a application but still having problems with being new to c#. I am looking to encrypt/hash passwords to md5 or sha-256, preferably sha-256. Any good examples? I want it to be able to take the information from "string…
Sean
  • 541
  • 1
  • 6
  • 4
41
votes
3 answers

How to calculate sha256 file checksum in Go

I need utility for Windows that calculates sha256 file checksum so that when I download fedora I can verify checksum from here: https://fedoraproject.org/static/checksums/Fedora-18-i386-CHECKSUM Microsoft utility from…
alpav
  • 2,972
  • 3
  • 37
  • 47
40
votes
11 answers

How to sign a JWT using RS256 with RSA private key

I am using the jose-jwt library and want to create a signed JWT in C# using the RS256 algorithm for encryption. I have no experience with cryptography, so please excuse my ignorance. I see the following example in the docs: var payload = new…
FullStack
  • 5,902
  • 4
  • 43
  • 77
39
votes
1 answer

sha-256 hashing in python

I wanted to create a python program thats asks for an input then hashes(sha-256) the input then prints it. Does this already exist? How would I go about doing so.
User9123
  • 596
  • 2
  • 7
  • 14
39
votes
2 answers

Python: TypeError: Unicode-objects must be encoded before hashing

I am trying to read in a file of passwords. Then I am trying to compute the hash for each password and compare it to a hash I already have to determine if I have discovered the password. However the error message I keep getting is "TypeError:…
user3479683
  • 493
  • 1
  • 5
  • 6
36
votes
6 answers

SHA-256 implementation in Python

I'm looking for a Python implementation of the SHA-256 hash function. I want to use it to get a better understanding of how the SHA-256 function works, and I think Python is the ideal language for this. Pseudo-code has the limitation that I can't…
runeks
  • 1,745
  • 2
  • 17
  • 26
35
votes
9 answers

How can I hash a string with SHA256 in JS?

Description I'm looking to hash a string locally with SHA256 in Javascript. I've been looking around thinking there would be some sort of official library or function, but all I found were loads of different projects, each with different scripts,…
Federico Fusco
  • 545
  • 1
  • 5
  • 18
31
votes
4 answers

Using HMAC SHA256 in Ruby

I'm trying to apply HMAC-SHA256 for generate a key for an Rest API. I'm doing something like this: def generateTransactionHash(stringToHash) key = '123' data = 'stringToHash' digest = OpenSSL::Digest.new('sha256') hmac =…
Eduardo Pedroso
  • 839
  • 3
  • 12
  • 30
31
votes
1 answer

SHA256withRSA what does it do and in what order?

I'm a total newbie when it comes to cryptography and such things. I don't (and dont want to) know the details of the SHA256 and RSA. I "know" what they do, not how they do it, and for now that's enough. I'm wondering what the…
Whyser
  • 2,187
  • 2
  • 20
  • 40
31
votes
1 answer

Why are the RSA-SHA256 signatures I generate with OpenSSL and Java different?

I want to generate a RSA-SHA256 signature in Java, but I can't get it to produce the same signature as with OpenSSL on the console. This is what I did with OpenSSL (following this tutorial): Generate key pair: openssl genrsa -out private.pem…
Arthur Dent
  • 1,248
  • 2
  • 12
  • 23
29
votes
2 answers

How to compare [32]byte with []byte?

I want to compare output of sha256.Sum256() which is [32]byte with a []byte. I am getting an error "mismatched types [32]byte and []byte". I am not able to convert []byte to [32]byte. Is there a way to do this?
Sumit Rathore
  • 571
  • 2
  • 7
  • 19