sha1

How do I create a SHA1 hash in ruby?

SHA Hash functions ...

Password hash function for Excel VBA

I need a function written in Excel VBA that will hash passwords using a standard algorithm such as SHA-1. Something with a simple interface like: Public Function CreateHash(Value As String) As String ... End Function The function needs to work on an XP workstation with Excel 2003 installed, but otherwise must use no third party compo...

Is there an equivalent to SHA1() in MS-SQL?

Converting a couple stored procedures from MySQL to Microsoft SQL server. Everything is going well, except one procedure used the MySQL SHA1() function. I cannot seem to find an equivalent to this in MS-SQL. Does anyone know a valid equivalent for SHA1() on MS-SQL? ...

Git - finding the SHA1 of an individual file in the index

I've added a file to the 'index' with: git add myfile.java How do I find out the SHA1 of this file? ...

Git - finding a filename from a SHA1

I added a file to the index with: git add somefile.txt I then got the SHA1 for this file with: git hash-object somefile.txt I now have a SHA1 and I would like to retrieve the filename of the object in the index using the SHA1. git show 5a5bf28dcd7944991944cc5076c7525439830122 This command returns the file contents but not the na...

A Regex to match a SHA1

I'm trying to match SHA1's in generic text with a regular expression. Ideally I want to avoid matching words. It's safe to say that full SHA1's have a distinctive pattern (they're long and a consistent length) - so I can match these reliably - but what about abbreviated SHA1's? Can I rely on the presence of numbers? Looking at the S...

Reimplement ASP.NET Membership and User Password Hashing in Ruby

I have a large database of users (~200,000) that I'm transferring from a ASP.NET application to a Ruby on Rails application. I don't really want to ask every user to reset their password and so I'm trying to re-implement the C# password hashing function in Ruby. The old function is this: public string EncodePassword(string pass, strin...

How would I get a Hash value of a users file with Javascript or Flash?

What I need to do is provide a file browser box on a web page where a user selects a file from their computer and, through javascript (or flash if necessary), some sort of Hash is returned such as CRC, MD5 or SHA1. I would prefer not to have to upload the entire file to the web server, as I expect some rather large files to be used in th...

How do you verify an RSA SHA1 signature in Python?

I've got a string, a signature, and a public key, and I want to verify the signature on the string. The key looks like this: -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDfG4IuFO2h/LdDNmonwGNw5srW nUEWzoBrPRF1NM8LqpOMD45FAPtZ1NmPtHGo0BAS1UsyJEGXx0NPJ8Gw1z+huLrl XnAVX5B4ec6cJfKKmpL/l94WhP2v8F3OGWrnaEX1mLMoxe124Pcfamt0...

Assigning Git SHA1's without Git

As I understand it when Git assigns a SHA1 hash to a file this SHA1 is unique to the file based on its contents. As a result if a file moves from one repository to another the SHA1 for the file remains the same as its contents have not changed. How does Git calculate the SHA1 digest? Does it do it on the full uncompressed file conten...

Not getting a sha1 match in my C# to PHP code conversion, what am I missing?

I'm trying to understand this so I can do something similar. I know: buf contains an authentication key with a hash appended to it (the last 20 bytes) The HashData that's being looked up in the MachineKeySection is SHA1 length -= 20; byte[] buffer2 = MachineKeySection.HashData(buf, null, 0, length); for (int i = 0; i < 20; i++) { ...

Why is my SHA1 hash not matching?

I don't think I was specific enough last time. Here we go: I have a hex string: 742713478fb3c36e014d004100440041004 e0041004e00000060f347d15798c9010060 6b899c5a98c9014d007900470072006f007 500700000002f0000001f7691944b9a3306 295fb5f1f57ca52090d35b50060606060606 The last 20 bytes should (theoretically) contain a SHA1 Hash o...

Storing SHA1 hash values in MySQL

Hi. I have a simple question which occured when I wanted to store the result of a SHA1 hash in a MySQL database: How long should the VARCHAR field be in which I store the hash's result? ...

How does .net create an SHA1 hash?

Are there built in techniques for doing this? What arguments does it expect? ...

If .net sha1 hash expects a byte array, and php sha1() wants a string, can I match the results?

I have a set of bytes I want to apply an sha1 hash to. One hash will be in .net, the other in PHP. Then I'll test to see if they match. In .net, you can create a byte array and use sha.ComputeHash(). byte[] data = new byte[DATA_SIZE]; byte[] result; SHA1 sha = new SHA1CryptoServiceProvider(); // This is one implementation of the abs...

Fastest Sha1 Function (Linux, up to 2GB files)

Is there any linux command line implementation that performs exceptionally well for generating sha1's on large files (< 2GB)? I have played around with 'openssl sha1' and it takes minutes to get the sha1 for a 2GB file : /. ...

Is it possible to compute a file's SHA1 ID using Javascript?

If this were possible to do prior to posting a form, it may save me having to upload the file to my server... ...

SHA1 hashes not matching between my Rails and Cocoa apps

I have a Cocoa app send some data along with a SHA1 hash of that data to a Rails app which verifies that the data and the hash match, but they do not. To be sure I have logged hex versions of the data that is hashed to the console at both the Rails and Cocoa sides, and they match exactly. Here's the Cocoa part: #import <CommonCrypto/C...

Optimum tempory password length for SHA hash

When creating a "forgotten password" mechanism, we might want to create a tempory password for the user which is stored using SHA1 (feel free to suggest other C# Cryptography mechanism). How long should we make the tempory password? Too short, it could be brute forced. Too long and the unnecessary length is redundant since the string is...

iPhone and HMAC-SHA-1 encoding

im trying to get a call to amazon web service and im stuck on getting the signature, looked at this but i still have a question on it. using this example what is the NSData *keyData; NSData *clearTextData ? what do i need to pass for these two values? /* inputs: NSData *keyData; NSData *clearTextData */ uint8_t digest[CC_S...