sha1

Migrating Rails restful authentication users to Django

Hello! I'm looking to migrate users of a rails app which uses the Restful Authentication module (which uses a stretched sha1 encryption algorithm) to a Django app, using the default authentication framework (which uses a plain sha1 algorithm). Does anybody know how I can make this happen? specifically, can I somehow implement the same e...

How insecure is a salted SHA1 compared to a salted SHA512

SHA512 is more complex than SHA1, but how much security am I losing by hashing a salted password with SHA1 compared to hashing it with 512? in terms of the time it would take for someone who has the db to crack a single password. I'm using a framework that doesn't give me easy access to SHA512, I'd have to override stuff to make it work,...

crc64-jones or crc64-ecma available in ruby?

I read a paper that explained that using CRCs generated from the CRC-64-ISO algorithm as hash keys is likely to result in collisions for large sets of data. Postmodern's Ruby CRC project is pretty interesting, but the CRC64 class seems to be using the CRC-64-ISO algorithm. I'm hoping to generate probably-unique ids from canonical input...

Calculate SHA1 digest in Ruby of a Bignum

Hi, I have this code in C that use openssl library to calculate the SHA1 digest of a bignumber. How I can translate this code in Ruby? #include <stdio.h> #include <openssl/sha.h> #include <openssl/bn.h> int main () { // Create a bignum = 3 struct bignum_st *bn = BN_new (); BN_set_word (bn, 3); // Initialize SHA1 contex...

What does the $4$ mean in the output of sha1pass?

When creating a password with sha1pass, the first value from the token, is '4'. For instance: sha1pass test gives us: $4$GTdnmykS$25iwV+ruXRwor4pUmKF57uXHj70$ The token uses $ as separators: 25iwV+ruXRwor4pUmKF57uXHj70 is the computed hash, GTdnmykS is the generated salt, since I didn't supply a second parameter, but what does tha...

Is any substring of an encrypted 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 hash. Is the beginning part of the hash particularly more "random" than the end? middle? ...

Does system.security.cryptography.sha1 use OpenSSL library's implementation of SHA1 algorithm?

or is the algorithm custom implemented by Microsoft? i tested that SHA1 computed using OpenSSL on mac is equivalent to the hash computed in C# using system.security.cryptography.sha1. ...

Cygwin and Tortoise Git

I have recently installed Cygwin along with the Git binaries and a copy of Tortoise Git on a fresh Windows XP install. I seem to be able to do most Git operations through Tortoise such as viewing the logs etc, but when I come to commit via Tortoise I get this message... error: unable to create temporary sha1 filename : No such file...

Convert SHA1 back to string

I have a user model on my app, and my password field uses sha1. What i want is to, when i get the sha1 from the DB, to make it a string again. How do i do that? ...

Hashed passwords updated through JDBC become corrupt. (More of encoding problem than hashing)

I've tried the following with MySQL UTF-8 and Latin-1, to no avail. I hash my passwords (in this case toSecurify) using SHA-1 like so: if(toSecurify == null) { throw new Exception("toSecurifyString must not be null"); } try { MessageDigest messageDigest = MessageDigest.getInstance("SHA-1"); byte[] sha1HashBytes = new by...

Sha1 substring question

I am making a pastebin type site and am trying to make the id be a random string like paste.com/4RT65L I am getting the sha1 of the id before i add it to the database but i am getting the substring of the first 8 characters of the sha1. is their a possibility of their being a double copy of the same sha1? I dont want their to accidental...

Password security: sha1, sha256 or sha512

Hi, After knowing that hashing a password is my choice for making a login form. Now I am facing another issue - sha1, sha256 or sha512? This is a standard method using salt I think I got it from a reference book of mine, # create a salt using the current timestamp $salt = time(); # encrypt the password and salt with SHA1 $usr_passwor...

Convert python to c#

Can someone please help me convert the following two lines of python to C#. hash = hmac.new(secret, data, digestmod = hashlib.sha1) key = hash.hexdigest()[:8] The rest looks like this if you're intersted: #!/usr/bin/env python import hmac import hashlib secret = 'mySecret' data = 'myData' hash = hmac.new(secret, data, digest...

Difference in SHA1 in .NET and MySQL

Hey, I have a couple different bits of code but the short story is I insert some passwords into a MySQL database using SHA1 and also compute SHA1 hashes into .NET and they are not matching. I think this is a problem with my encoding code in .NET. SQL Code: INSERT INTO user_credentials (Password) VALUES (SHA1('password')); password h...

Using System.Security.Cryptography to encrypt text to match OpenSSL

I need to encrypt text (a password specifically) correctly so a 3rd party can decrypt it. They have provided me with the key they use to decrypt and told me that they will be decrypting it on their end with OpenSSL. I have been trying to get the AESManaged, and the RijndaelManaged classes in System.Security.Cryptography to create someth...

Stored procedure that (doesn't) returns hashed string

I'm trying to write a Stored Procedure which'll get a string, hash it with SHA1 and then return the hash. I can't seem to make it return @hashedString. I'll admit I'm a total beginner with T-SQL. I'm writing the T-SQL directly in the db. This is what I've gotten up to now: ALTER PROCEDURE dbo.ConvertToHash ( @stringToHash nvarcha...

Help with SHA1 or MD5 in PHP

Hi, I have created a form that inserts the entered data into the database. It works perfectly except when I put SHA1('$password') into the INSERT INTO VALUSE tag. If I put only '$password it works fine. Putting SHA1 displays - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the r...

Generate md5 or sha1 hash across windows & linux system in php

I m trying to generate a signature using md5 or sha1 hash on a linux system. This signature will be tested across a windows system to ensure it authenticates. What i find is both hash generated using same parameters are different. Please help how i can generate a common hash on both system for authentication. ...

integrating java code with a browser

This question is a general one. I have java code for hmac(sha1 and md5) coding and a client server key exchange protocol(both codes in java). Now i want to embed/integrate this with a browser to implement password hashing. Any ideas how i might proceed about it? ...

How do I convert a Bit Torrent info_hash (obtained from Wireshark) to a SHA1 hash

I'm running Snort which detects some P2P activity, specifically the BitTorrent announce request. I see the HTTP GET /announce.php?info_hash=XXX... request and I'm trying to convert this XXX into a proper SHA1 hash to try and get an idea of what is being downloaded. I've read various things that say this is URL encoded, and others that s...