sha1

Is it possible to reverse a sha1?

Hi Is it possible to reverse a sha1? I'm thinking about using a sha1 to create a simple lightweight system to authenticate a small embedded system that communicates over a unencrypted connection. Let's say that I create a sha1 like this with input from a "secret key" and spice it with a timestamp so that the sha will change all the t...

(PHP) SHA1 vs md5 vs SHA256: which to use for a PHP login?

I'm making a php login, and I'm trying to decide whether to use SHA1 or Md5, or SHA256 which I read about in another stackoverflow article. Are any of them more secure than others? For SHA1/256, do I still use a salt? Also, is this a secure way to store the password as a hash in mysql? function createSalt() { $string = md5(uniqid(...

Is Forms Authentication Hash machine dependent?

I'm planning to use this piece of code in my Asp.net app string strUserInputtedHashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(tbPassword.Text, "sha1"); if(strUserInputtedHashedPassword == GetUsersHashedPasswordUsingUserName(tbUserName.Text)) { // sign-in successful } else { // sign-in failed } Is the Has...

How to encrypt Amazon CloudFront signature for private content access using canned policy

Has anyone using .net actually worked out how to successfully sign a signature to use with CloudFront private content? After a couple of days of attempts all I can get is Access Denied. I have been working with variations of the following code and also tried using OpenSSL.Net and AWSSDK but that does not have a sign method for RSA-SHA1 ...

Is SHA sufficient for checking file duplication? (sha1_file in PHP)

Suppose you wanted to make a file hosting site for people to upload their files and send a link to their friends to retrieve it later and you want to insure files are duplicated where we store them, is PHP's sha1_file good enough for the task? Is there any reason to not use md5_file instead? For the frontend, it'll be obscured using the...

Javascript - Convert string to UTF-16

I am working with Javascript for one of the first times and its for a sha-1 hash. I have found code to do this, but one of its dependencies is a method to convert the string to utf-8, however the server I am comparing against utilizes utf-16. I have looked around and all my results keep showing up w/ utf-8. Can anybody at least point me ...

How can I use the Whirlpool hash with Django authentication ?

We have a system written in PHP where account passwords are stored as the first 128 chars of a whirlpool hash of the password. I'd like to transition to handling the logins with Django without changing the database or asking users to change their passwords. Also, I'd prefer to stick with whirlpool vs. the less secure hashes Django has b...

Is there any x for which SHA1(x) equals x?

Does |{ x | x = sha1(x)}| > 0 hold? I'm looking for a proof or a strong argument against it. ...

SHA1 hash question

Hi, I have this method to hash a string: byte[] buffer = enc.GetBytes(text); SHA1CryptoServiceProvider cryptoTransformSHA1 = new SHA1CryptoServiceProvider(); string hash = BitConverter.ToString( cryptoTransformSHA1.ComputeHash(buffer)).Replace("-", ""); return hash; My question is: Is the result...

How can i create a stable checksum of a media file?

how can i create a checksum of only the media data without the metadata to get a stable identification for a media file. preferably an cross platform approach with a library that has support for many formats. e.g. vlc, ffmpeg or mplayer. (media files should be audio and video in common formats, images would be nice to have too) ...

unique hash of string

Hi, I want to create a unique hash (16 chars long) of an arbitrary length String. Is there a good library that implements MD5 or SHA-1 for C++ with which I can achieve this? (and possibly an example of how to use it) ...

SHA1 base64 algorithm in javascript and C#

Hi I'm running some tests comparing the sha1 algorithm implemented in javascript - got from http://pajhome.org.uk/crypt/ - with its implementation in C#. Using C# to get the hash for {'method':'people.get'} I'm using this statement: Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encod...

Where can I find a C# implementation of SHA-1 not using the built in libraries?

I am trying to rewrite the sha-1 algorithm for parallelization in a personal project of mine. Just wondering if anyone knows where I can find a C# implementation of the actual mathematical operations to perform the hash, not just the System.Security.Cryptography function. ...

PBKDF2-HMAC-SHA1

To generate a valid pairwise master key for a WPA2 network a router uses the PBKDF2-HMAC-SHA1 algorithm. I understand that the sha1 function is performed 4096 times to derive the PMK, however I have two questions about the process. Excuse the pseudo code. 1) How is the input to the first instance of the SHA1 function formatted? SHA1("...

Is it possible to convert a 40-character SHA1 hash to a 20-character SHA1 hash?

My problem is a bit hairy, and I may be asking the wrong questions, so please bear with me... I have a legacy MySQL database which stores the user passwords & salts for a membership system. Both of these values have been hashed using the Ruby framework - roughly like this: hashedsalt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--...

Is it possible to get identical SHA1 hash?

Given two different strings S1 and S2 (S1 != S2) is it possible that: SHA1(S1) == SHA1(S2) is True? If yes - with what probability? If not - why not? Is there a upper bound on the length of a input string, for which probably of getting duplicates is 0? OR is the calculation of SHA1 (hence probability of duplicates) independent o...

Can SHA-1 algorithm be computed on a stream? With low memory footprint?

I am looking for a way to compute SHA-1 checksums of very large files without having to fully load them into memory at once. I don't know the details of the SHA-1 implementation and therefore would like to know if it is even possible to do that. If you know the SAX XML parser, then what I look for would be something similar: Computin...

How do I verify a DKIM signature in PHP?

I'll admit I'm not very adept at key verification. What I have is a script that downloads messages from a POP3 server, and I'm attempting to verify the DKIM signatures in PHP. I've already figured out the body hash (bh) validation check, but I can't figure out the header validation. http://www.dkim.org/specs/rfc4871-dkimbase.html#rfc.se...

PHP How to create real hex values from a string

Hi, I have a string with hexvalues that I use with sha1() echo sha1("\x23\x9A\xB9\xCB\x28\x2D\xAF\x66\x23\x1D\xC5\xA4\xDF\x6B\xFB\xAE\x00\x00\x00\x01"); ab94fcedf2664edfb9b291f85d7f77f27f2f4a9d now I have another string with the same value only not hex. $string2=strtoupper("239ab9cb282daf66231dc5a4df6bfbae00000001"); I want to co...

File hash: Does it change for same content but in different order?

Let's say there is a file called myfile.txt with the following contents: one two three Another file called yourfile.txt with following contents: two three one Will the SHA-1 hash be the same for both of these files, because the content are same but in different order? ...