Questions tagged [sha1]

SHA-1 is a cryptographic hash function designed by the U.S. Government as a Federal Information Processing Standard. Recently, collisions have been detected, meaning that SHA1 is becoming more vulnerable to attacks, and its use for protecting data is not recommended.

NOTE: Sha1 is no longer secure due to collisions being found. It is recommended you use or another hashing system like

In cryptography, SHA-1 is a cryptographic hash function designed by the National Security Agency (NSA) and published by the NIST as a U.S. Federal Information Processing Standard. SHA stands for Secure Hash Algorithm. The three SHA algorithms are structured differently and are distinguished as SHA-0, SHA-1, and SHA-2. SHA-1 is very similar to SHA-0, but corrects an error in the original SHA hash specification that led to significant weaknesses. The SHA-0 algorithm was not adopted by many applications. SHA-2 on the other hand significantly differs from the SHA-1 hash function.

SHA-1 is the most widely used of the existing SHA hash functions, and is employed in several widely-used security applications and protocols. In 2005, security flaws were identified in SHA-1, namely that a mathematical weakness might exist, indicating that a stronger hash function would be desirable. Although no successful attacks have yet been reported on the SHA-2 variants, they are algorithmically similar to SHA-1 and so efforts are underway to develop improved alternatives. A new hash standard, SHA-3, is currently under development — an ongoing NIST hash function competition is scheduled to end with the selection of a winning function in 2012.

References:

1825 questions
28
votes
3 answers

Convert a string to a byte array in PowerShell version 2

What I'm trying to do is use SHA1 UTF-8 encryption and then base64 encoding and on a password string value. However, I needed to do the encryption first, then the encoding, but I did it the other way around. Here is the code: # Create Input Data…
James Drinkard
  • 15,342
  • 16
  • 114
  • 137
27
votes
7 answers

How to hash a large object (dataset) in Python?

I would like to calculate a hash of a Python class containing a dataset for Machine Learning. The hash is meant to be used for caching, so I was thinking of md5 or sha1. The problem is that most of the data is stored in NumPy arrays; these do not…
Sickbock
27
votes
6 answers

How much can you truncate a SHA1 hash and be reasonably sure of having an unique ID?

I am making an application that stores documents and gives each one a UID based on a SHA1 digest of a few things including the timestamp. The digest has a lot of characters, and I want to allow users to identify the documents by using the first x…
dan
  • 43,914
  • 47
  • 153
  • 254
25
votes
3 answers

What hash algorithms are parallelizable? Optimizing the hashing of large files utilizing on multi-core CPUs

I'm interested in optimizing the hashing of some large files (optimizing wall clock time). The I/O has been optimized well enough already and the I/O device (local SSD) is only tapped at about 25% of capacity, while one of the CPU cores is…
DanO
  • 2,526
  • 2
  • 32
  • 38
25
votes
4 answers

Extract the SHA1 hash from a torrent file

I've had a look around for the answer to this, but I only seem to be able to find software that does it for you. Does anybody know how to go about doing this in python?
user271528
25
votes
7 answers

How to Use SHA1 or MD5 in C#?(Which One is Better in Performance and Security for Authentication)

In C# how we can use SHA1 automatically?Is SHA1 better than MD5?(We use hashing for user name and password and need speed for authentication)
Sajad Bahmani
  • 17,325
  • 27
  • 86
  • 108
24
votes
15 answers

How to get SHA1 code in new version of android studio 4.2?

Before this update we can get SHA1 code from Gradle but now it's look like it's changed.
Krushal Virani
  • 251
  • 1
  • 2
  • 3
24
votes
4 answers

Is any substring of a hash (md5, sha1) more "random" than another?

Here's 3 example md5 hashes $ md5 -s "1" && md5 -s "2" && md5 -s "3" MD5 ("1") = c4ca4238a0b923820dcc509a6f75849b MD5 ("2") = c81e728d9d4c2f636f067f89cc14862c MD5 ("3") = eccbc87e4b5ce2fe28308fd9f2a7baf3 Say I wanted to take 8 characters from any…
maček
  • 76,434
  • 37
  • 167
  • 198
23
votes
5 answers

How do I check if a string is a valid md5 or sha1 checksum string

I don't want to calculate a file's checksum, just to know if a given string is a valid checksum
yossis
  • 1,243
  • 2
  • 11
  • 11
23
votes
3 answers

sha1 password hash linux

What i want is to be able to get the sha1 hashed value of a particular password. So for instance if my password was "hello" what command would i need to type into linux to get the sha1 hashed value of hello? I tried echo -n "hello" | sha1sum but…
Dan
  • 707
  • 3
  • 10
  • 18
22
votes
7 answers

Converting char* to unsigned char*

How do I copy a char* to a unsigned char* correctly in C. Following is my code int main(int argc, char **argv) { unsigned char *digest; digest = malloc(20 * sizeof(unsigned char)); strncpy(digest, argv[2], 20); return 0; } I would…
Rajiv
  • 545
  • 1
  • 6
  • 12
22
votes
4 answers

Your Operation was forbidden issue in Firebase Console

I created an Android Project. Now I want to add Firebase into my android project. I register my application on firebase console. Now When I try to add my sha-1 key in to project it gives me following error. I search on google and stackoverflow but…
Arjun
  • 736
  • 1
  • 8
  • 24
21
votes
3 answers

Which git commands perform integrity checks?

Trying to determine how quickly a user would be warned of corruption in the object database with git-1.7.4.1, I pulled a one-bit switcheroo: $ git init repo Initialized empty Git repository in /tmp/repo/.git/ $ cd repo $ echo 'very important info'…
Greg Bacon
  • 134,834
  • 32
  • 188
  • 245
21
votes
16 answers

Android: Google Map v2 not showing map for release apk

My google map app works fine on device with debug google map API KEY but when I create signed apk for my app with release google map API KEY, it does not display map. To generate release mode google API KEY , i am using SHA1 fingerprint with my…
sam2395
  • 229
  • 1
  • 2
  • 7
21
votes
3 answers

Is any 64-bit portion of a 128-bit hash as collision-proof as a 64-bit hash?

We're trying to settle an internal debate on our dev team: We're looking for a 64-bit PHP hash function. We found a PHP implementation of MurmurHash3, but MurmurHash3 is either 32-bit or 128-bit, not 64-bit. Co-worker #1 believes that to produce a…
richardkmiller
  • 2,902
  • 3
  • 31
  • 29