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
20
votes
2 answers

SHA 256 Different Result

If I invoke the command from Mac echo hello | shasum -a 256 or from ubuntu echo hello | sha256sum Then I get the following result 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03 - I notice there is dash at the end. But when I…
4af2e9eb6
  • 682
  • 3
  • 7
  • 20
20
votes
4 answers

Is it okay to truncate a SHA256 hash to 128 bits?

MD5 and SHA-1 hashes have weaknesses against collision attacks. SHA256 does not but it outputs 256 bits. Can I safely take the first or last 128 bits and use that as the hash? I know it will be weaker (because it has less bits) but otherwise will it…
Sunny Hirai
  • 201
  • 1
  • 2
  • 3
20
votes
4 answers

How do I check if my SSL Certificate is SHA1 or SHA2 on the commandline

How do I check if my SSL Certificate is using SHA1 or SHA2, from the commandline? And yes, i this is similar to this, but i need a cli-tool and i want to understand how it is done.
20
votes
2 answers

Exception when calling MessageDigest.getInstance("SHA256")

I have code that works well on Android. When I ported it to my Windows 64-bit machine with JRE 1.6, the code did not work. When I run the following line of code: final MessageDigest digest = MessageDigest.getInstance("SHA256") I get the following…
kingston
  • 11,053
  • 14
  • 62
  • 116
19
votes
4 answers

SHA256 performance optimization in C

I need to hash a big database of values quite often. Thus, a fast implementation of a SHA-2 hasher is needed. I'm currently using the SHA256. The sha256_transform algorithm I'm using right now is this: http://bradconte.com/sha256_c (code below) I…
user2464424
  • 1,536
  • 1
  • 14
  • 28
19
votes
3 answers

xcode ios HMAC SHA 256 hashing

So I'm trying to figure out how to do a hmacshad256 hash on ios as that's the hash I did for the wcf service api I made. I've been trying to look for some info about it but would usually just end up getting a SHA-256 hash. This is the only…
gdubs
  • 2,724
  • 9
  • 55
  • 102
19
votes
2 answers

How to use OpenSSL's SHA256 functions

I'm writing a program to get myself acquainted with OpenSSL, libncurses, and UDP networking. I decided to work with OpenSSL's SHA256 to become familiar with industry encryption standards, but I'm having issues with getting it working. I've isolated…
millinon
  • 1,528
  • 1
  • 20
  • 31
18
votes
3 answers

SHA256 signing stops working in .NET 4.5

We have a piece of code which creates a SigningCredentials object to use to sign xml document by using SHA256 algorithm. It works with .NET 3.5 perfectly. However, when we upgrade our codebase to .NET 4.5, it stops working. Same code, same…
Thuan
  • 1,618
  • 1
  • 10
  • 21
18
votes
5 answers

Generate SHA256 hash in Objective-C

So I need to generate a Sha256 password in Objective-C, and can't figure out for the life of me how to do it! Is there something easy I'm just missing? I've tried implementing the following method (which was written for iPhone, but I figured maybe…
garetmckinley
  • 1,122
  • 2
  • 11
  • 29
17
votes
2 answers

How to Hash Value in Flutter Using SHA256?

Hashing Value (String or Int OR etc...) in Flutter ## Heading ## I have Value like "Almahery" How to Hash in in SHA 256 ?
Muhammad Ashraf
  • 3,323
  • 2
  • 12
  • 19
17
votes
7 answers

Java: Calculate SHA-256 hash of large file efficiently

I need to calculate a SHA-256 hash of a large file (or portion of it). My implementation works fine, but its much slower than the C++'s CryptoPP calculation (25 Min. vs. 10 Min for ~30GB file). What I need is a similar execution time in C++ and…
stefita
  • 1,785
  • 2
  • 20
  • 35
16
votes
6 answers

Why isn't my PHP SHA256 hash equivalent to C# SHA256Managed hash

Why aren't these the same? php: $hash = hash('sha256', $userData['salt'] . hash('sha256', $password) ); c# public static string ComputeHash(string plainText, string salt) { // Convert plain text into a byte array. byte[]…
Lemontongs
  • 163
  • 1
  • 1
  • 4
16
votes
4 answers

pyspark generate row hash of specific columns and add it as a new column

I am working with spark 2.2.0 and pyspark2. I have created a DataFrame df and now trying to add a new column "rowhash" that is the sha2 hash of specific columns in the DataFrame. For example, say that df has the columns: (column1, column2, ...,…
msashish
  • 277
  • 2
  • 6
  • 18
16
votes
3 answers

How many combinations does SHA-256 have?

By using an online tool and wikipedia I found out that every sha-256 encrypted string is 64 chars longs containing numbers and characters. Hence I assumed that there are 34^36 combinations ( 2^216 simplified by an algebra calculator ). After doing…
WoffeLL
  • 163
  • 1
  • 1
  • 4
16
votes
4 answers

Sha256 in Objective-C for iPhone

When I use this code to create a sha256 of a string unsigned char hashedChars[32]; NSString *inputString; inputString = [NSString stringWithFormat:@"hello"]; NSData * inputData = [inputString…
pascalbros
  • 16,122
  • 5
  • 23
  • 35