1) For the purpose of really low hash collision, can I get away with just using half of the 128 bits of a sha1 rather than dealing with the sha1 itself? I understand this is not suitable for cryptographic hashes, but I just need the hashes for hash table keys.
2) Computation time isn't a priority, and besides which I'm hashing very smal...
I need to generate HMAC-SHA1 in Objective C. But i didnt find anything that works. I tried with CommonCrypto, using CCHMAC, but didnt works. I need to generate a hmac and after generate HOTP number.
Somebody have any example code in Objective C or C?
...
Hey, I am trying to calculate a SHA-1 Hash from a string, but when I calculate the string using php's sha1 function I get something different than when I try it in C#. I need C# to calculate the same string as PHP (since the string from php is calculated by a 3rd party that I cannot modify). How can I get C# to generate the same hash as ...
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 provide a __hash__() member. Currently I do a pickle.dumps() for each member and calculate a...
I am using the following code to generate an encrypted token:
var ticket = new System.Web.Security.FormsAuthenticationTicket(
2,
"",
DateTime.Now,
DateTime.Now.AddMinutes(10),
false,
"user id here");
var cipherText = System.Web.Security.FormsAuthentication.Encrypt(ticket);
This code uses the key and algori...
Looking for stats for input sizes of at least between 4 and 30 MB.
...
Hello,
In my program, we store a user's IP address in a record. When we display a list of records to a user, we don't want to give away the other user's IP, so we SHA1 hash it. Then, when the user clicks on a record, it goes to a URL like this:
http://www.example.com/allrecordsbyipaddress.php?ipaddress=SHA1HASHOFTHEIPADDRESS
Now, I ne...
Recently my main machine i use for development started overheating. I started to get 4 5 lockups per day. Everything freezes. All my projects are under version control using git. I remember watching linus's talk at google saying git will ensure that the files are not corrupt. In my situation is it safe to assume that git will warn me if ...
Assume I have two strings (or byte arrays) A and B which both have the same hash (with hash I mean things like MD5 or SHA1). If I concatenate another string behind it, will A+C and B+C have the same hash H' as well? What happens to C+A and C+B?
I tested it with MD5 and in all my tests, appending something to the end made the hash the sa...
I am trying to calculate the info_hash value for a torrent. I read the whole torrent into StringBuffer, then cut it like the following:
d8:announce...info[d6:length...e]e
I can't seem to get the correct hash. Does reading the torrent into a StringBuffer corrupt the byte string at the end? Am I missing something?
public void calculate...
Hello, sorry for my english.
I have a little problem. I want to verify the integrity of my certificat.
I make this code:
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
SHA1Managed sha1 = new SHA1Managed();
RSACryptoServiceProvider csp = null;
AsymmetricA...
I was wondering if there would be a way to get a HMAC-SHA1 signature in scala without having to compile a java class with the code everyone use in java. Any ideas?
...
Is there any chance that a SHA-1 hash can be purely numeric, or does the algorithm ensure that there must be at least one alphabetical character?
Edit: I'm representing it in base 16, as a string returned by PHP's sha1() function.
...
Hello,
I am setting a cookie something like:
$_COOKIE['test'] = SHA1('124'.'mysalt');
Now 124 is my id which i want. So in my mysql table, I am trying to run a query like:
$sql = ("SELECT * FROM users WHERE SHA1(`id`) = '".mysql_real_escape_string($_COOKIE['test'])."'");
Problem is how to do I add the "mysalt" to the sql query? Be...
Hi
I am programming a new site in JSF. At the moment i program the Login.
I used md5 some years ago, but with Rainbow Tables i think its noch safe anymore.
So, how should i store the Password in the Database ?
...
According to various sources, attacks looking for sha-1 collisions have been improved to 2^52 operations:
http://www.secureworks.com/research/blog/index.php/2009/6/3/sha-1-collision-attacks-now-252/
What I'd like to know is the implication of these discoveries on systems that are not under attack. Meaning if I hash random data, what ar...
Hello everyone,
I try to invoke the following code to get SHA1 working on the iPhone:
uint8_t digest[CC_SHA1_DIGEST_LENGTH] = {0};
CC_SHA1(keyData.bytes, keyData.length, digest);
keyData simply contains a constant string of hex code. However the hash hex that I get as a result of this does not match what online SHA1 generators output...
I have an edge case. I'm building code that reads binary datafiles produced by a commercial, closed source tool. The information on the data format is specified in a document.
For data integrity checks, the vendor's spec calls for an HMAC based on SHA1, using a key derived from a password as per RFC2898. Many programming environments h...
I was given C# code and I'm trying to generate the equivalent SHA1 using Perl.
public string GetHashedPassword(string passkey)
{
// Add a timstamp to the passkey and encrypt it using SHA1.
string passkey = passkey + DateTime.UtcNow.ToString("yyyyMMddHH0000");
using (SHA1 sha1 = new SHA1CryptoServiceProvider())
...
Given two different messages, A and B (maybe 20-80 characters of text, if size matters at all), what is the probability that the MD5 digest of A is the same as the MD5 digest of B and the SHA1 digest of A is the same as the SHA1 digest of B? That is:
(MD5(A) == MD5(B)) && (SHA1(A) == SHA1(B))
Assume no malicious intent, i.e., that th...