sha1

Why would HMAC SHA-1 return a different digest with the same input?

陌路散爱 提交于 2019-12-03 16:03:53
I am trying to build a working encrypted signature for the Amazon S3 web service, writing a connection library using Objective C. I have run into HMAC SHA-1 digest problems with the ObjC code, so I'm putting that to the side and looking at existing, working Perl code, to try to troubleshoot digest creation. I am testing HMAC SHA-1 digest output from the s3ls command of the Net::Amazon::S3 package and comparing that against the _encode subroutine that I pulled out and put into its own perl script: #!/usr/bin/perl -w use MIME::Base64 qw(encode_base64); use Digest::HMAC_SHA1; use String::Escape

Does i need different SHA1 key to perform Google Map

本小妞迷上赌 提交于 2019-12-03 15:34:49
Hj. I am using google map API v2 for project. In my office, it works fine with cert_fingerprint key 1 But when doing it in home, i got a blank google map. Trace log i can see this: 03-17 04:40:44.288 12461-12510/com.dump.dms E/Google Maps Android API﹕ In the Google Developer Console ( https://console.developers.google.com ) Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists: API Key: AIzaSyDEE3COcEWPZte_cpPl*********L2Cm_A Android Application ( < cert_fingerprint > ;< package_name >): EF:FA:C1:36:BD:FA:D6:6A:DE: ** : ** : ** :53:C8:8B:16:C1:15

many iterations on a hash: doesn't it reduces entropy?

两盒软妹~` 提交于 2019-12-03 14:52:33
I see this technique recommended in many places (including stack), and i can't get out of my head that this would reduce entropy! After all, you are hashing something again, that has already been hashed and has a collision chance. Wouldn't collision chance over collision chance results in more collision chances? After researching, it seems I'm wrong, but why? Since you tagged md5, I'll use that as an example. From wikipedia : if two prefixes with the same hash can be constructed, a common suffix can be added to both to make the collision more likely to be accepted as valid data by the

Produce MD5 or SHA1 hash code to long (64 bits)

我的梦境 提交于 2019-12-03 14:43:41
I need to compute a hash code of a string and store it into a 'long' variable. MD5 and SHA1 produce hash codes which are longer than 64 bits (MD5 - 128 bits, SHA1 - 160 bit). Ideas any one? Cheers, Doron You can truncate the hash and use just the first 64 bits. The hash will be somewhat less strong, but the first 64 bits are still extremely likely to be unique. For most uses of a hash this is both a common and perfectly acceptable practice. You can also store the complete hash in two 64-bit integers. I'm using this (Java): public class SimpleLongHash { final MessageDigest md; // public

Can a SHA-1 hash be all-zeroes?

房东的猫 提交于 2019-12-03 14:33:32
问题 Is there any input that SHA-1 will compute to a hex value of fourty-zeros, i.e. "0000000000000000000000000000000000000000"? 回答1: I don't think so. There is no easy way to show why it's not possible. If there was, then this would itself be the basis of an algorithm to find collisions. Longer analysis: The preprocessing makes sure that there is always at least one 1 bit in the input. The loop over w[i] will leave the original stream alone, so there is at least one 1 bit in the input (words 0 to

Computing SHA1 with ASP.NET Core

被刻印的时光 ゝ 提交于 2019-12-03 12:37:00
I've got a ASP.NET 5 RC1 (soon to be ASP.NET Core) Web Application project. It needs to compute SHA1 hashes. Various SHA1 subclasses are available and build under DNX 4.5.1, but there doesn't seem to be any available implementation under DNX Core 5.0. Do I have to add a reference to bring that code in, or is it simply not available for .NET Core yet? According to this article : .NET Core consists of a set of libraries, called “CoreFX”, and a small, optimized runtime, called “CoreCLR”. Sure enough, in the CoreFX repo, there are no subclasses of SHA1 : https://github.com/dotnet/corefx/tree

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

坚强是说给别人听的谎言 提交于 2019-12-03 09:35:12
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 completely maxed-out. I have more cores available, and in the future will likely have even more cores. So far I've only been able to tap into more cores if I happen to need multiple hashes of the same file, say an MD5 AND a SHA256 at the same time. I can use the same I/O stream to feed two or more hash algorithms, and I get the faster algorithms done for

What password encryption Hudson is using?

泪湿孤枕 提交于 2019-12-03 09:22:11
This is what I see in hudson/users/me/config.xml : [...] <hudson.security.HudsonPrivateSecurityRealm_-Details> <passwordHash>mEDUyJ:0c9e6f2556b9b3a0b9e9046c21490422b4a54877f057b527b2c0bd4dc83342d5</passwordHash> </hudson.security.HudsonPrivateSecurityRealm_-Details> [...] What is the algorithm (if SHA1, than what is the mEDUyJ prefix)? How can I get this hash in PHP, for example? The source code responsible for this is found in the hudson.security.HudsonPrivateSecurityRealm class (more specifically, the PasswordEncoder inner class). Consider your example: mEDUyJ

SHA1 hash producing different result in Objective-C and C#.NET

一曲冷凌霜 提交于 2019-12-03 09:12:11
Basically I want to write function that computes sha1 hash. So far I have tried is as follows. C#.NET byte[] p2 = System.Text.Encoding.Unicode.GetBytes("password"); System.Security.Cryptography.SHA1 sha = new System.Security.Cryptography.SHA1CryptoServiceProvider(); byte[] result = sha.ComputeHash(p2); string encodedPassword = Convert.ToBase64String(result); Output : 6Pl/upEE0epQR5SObftn+s2fW3M= Objective-C I have added classes for Base64 from NSData_Base64 Classes reference . NSString *password = @"password"; NSData *data = [password dataUsingEncoding:NSUTF8StringEncoding]; NSString

Base64 HMAC SHA1 String in VBA

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to convert an ASP/VBScript OAuth library to VBA. One of the challenges is this line of code: Get_Signature = b64_hmac_sha1(strSecret, strBaseSignature) This function, b64_hmac_sha1 is actually a function contained in a JavaScript library. It appears to me that calling a JavaScript function from VBA is fairly impractical. Because I know so little about encryption, it's not even clear to me what this b64_hmac_sha1 function does. Is HMAC SHA1 different from SHA1? I half suspect I might be able to find some VBA code online to do what