sha1

google maps api for android, getting SHA1 cert instead of MD5

南笙酒味 提交于 2019-11-28 18:32:01
when i try to get the MD5 fingerprint using keytool , I get a SHA1 fingerprint instead and the google maps doesnt recognize it. How do I get the MD5 fingerprint? Use JDK version 1.6 instead of 1.7 because 1.7 generates the fingerprint with SHA1 by default. or you can use (-v) option of the keytool to give you all supported algorithms output and you will find the MD5 in it. for examble : keytool -v -list -keystore [your keystore path] and then enter the password which is [android] by default (you can get the keystore path from Eclipse window>Prefs>Android>build). Sincerely, DigitalFox Rahul

Issues with SHA1 hash implementation in Android

…衆ロ難τιáo~ 提交于 2019-11-28 18:03:41
I have two small snippets for calculating SHA1. One is very fast but it seems that it isn't correct and the other is very slow but correct. I think the FileInputStream conversion to ByteArrayInputStream is the problem. Fast version: MessageDigest md = MessageDigest.getInstance("SHA1"); FileInputStream fis = new FileInputStream("path/to/file.exe"); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(fis.toString().getBytes()); DigestInputStream dis = new DigestInputStream(byteArrayInputStream, md); BufferedInputStream bis = new BufferedInputStream(fis); ByteArrayOutputStream

How to Use SHA1 or MD5 in C#?(Which One is Better in Performance and Security for Authentication)

风流意气都作罢 提交于 2019-11-28 17:53:33
In C# how we can use SHA1 automatically? Is SHA1 better than MD5?(We use hashing for user name and password and need speed for authentication) Not sure what you mean by automatically, but you should really use SHA256 and higher. Also always use a Salt ( code ) with your hashes. A side note, after time has passed, using hardened hashes is far better than using a plain speed-based hashing function. I.e.: hashing over a few hundred iterations, or using already proven hashing functions such as bcrypt (which is mentioned below I believe). A code sample for using a SHA256 hash function in .NET is as

Creating SHA1 Hash from NSString

杀马特。学长 韩版系。学妹 提交于 2019-11-28 17:22:38
问题 How can I create a SHA1 from a NSString . Let's say the NSString is set up as: NSString *message = @"Message"; I can use PHP to create a SHA1 hash with sha($message) . But unfortunately it doesn't work like that within Objective-C. 回答1: I have this in a category on NSString (available at https://github.com/hypercrypt/NSString-Hashes): #import <CommonCrypto/CommonDigest.h> ... - (NSString *)sha1 { NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding]; uint8_t digest[CC_SHA1_DIGEST

iPhone and HMAC-SHA-1 encoding

谁都会走 提交于 2019-11-28 16:55:25
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_SHA1_DIGEST_LENGTH] = {0}; CCHmacContext hmacContext; CCHmacInit(&hmacContext, kCCHmacAlgSHA1, keyData.bytes, keyData.length); CCHmacUpdate(&hmacContext, clearTextData.bytes, clearTextData.length); CCHmacFinal(&hmacContext, digest); NSData *out = [NSData dataWithBytes:digest

What checksum algorithm should I use?

余生长醉 提交于 2019-11-28 16:36:51
问题 I'm building a system which needs to be able to find if blobs of bytes have been updated . Rather than storing the whole blob (they can be up to 5MBs), I'm thinking I should compute a checksum of it, store this and compute the same checksum a little bit later, to see whether the blog has been updated. The goal is to minimize the following (in that order) : size of the checksum time to compute likeliness of collisions (2 identical checksums happening even if the content has been modified). It

Simple (non-secure) hash function for JavaScript? [duplicate]

耗尽温柔 提交于 2019-11-28 15:20:16
Possible Duplicate: Generate a Hash from string in Javascript/jQuery Can anyone suggest a simple (i.e. tens of lines of code, not hundreds of lines) hash function written in (browser-compatible) JavaScript? Ideally I'd like something that, when passed a string as input, produces something similar to the 32 character hexadecimal string that's the typical output of MD5, SHA1, etc. It doesn't have to be cryptographically secure, just reasonably resistant to collisions. (My initial use case is URLs, but I'll probably want to use it on other strings in the future.) Barak I didn't verify this myself

HMAC-SHA1 in bash

匆匆过客 提交于 2019-11-28 14:56:23
问题 Is there a bash script to generate a HMAC-SHA1 hash? I'm looking for something equivalent to the following PHP code: hash_hmac("sha1", "value", "key"); 回答1: I realise this isn't exactly what you're asking for, but there's no point in reinventing the wheel and writing a bash version. You can simply use the openssl command to generate the hash within your script. [me@home] echo -n "value" | openssl dgst -sha1 -hmac "key" 57443a4c052350a44638835d64fd66822f813319 Or simply: [me@home] echo -n

What is the format of a git tag object and how to calculate its SHA?

≯℡__Kan透↙ 提交于 2019-11-28 12:58:10
I am familiar with how Git creates SHA1 hashes for files (blobs) , but not how they are created for tag objects. I assume they are, if I create an annotated tag, but what is the recipe? And how might I replicate it outside of Git (e.g., in Perl or Python)? The content of a tag object is as follows: object <commit-sha1> type commit tag <tag-name> tagger <author-with-timestamp> <tag-message> Based on that text the SHA1 value is calculated. how might I replicate it outside of Git (e.g., in Perl or Python)? Take a look at libgit2 and its various bindings . Reverse engineer the format from a

MD5 and SHA1 C++ hashing library

混江龙づ霸主 提交于 2019-11-28 11:23:29
I'm trying to find a good (and well documented) hashing library to use with my C++ program, I only need to generate two hashes from a string. I've tried with crypto++ and mhash and I didn't manage to make them work, also with http://www.zedwood.com/article/121/cpp-md5-function I would be glad if this library is cross-platform. Try this open source library http://hashlib2plus.sourceforge.net/ peenut Search before ask, there is already question: What is the best encryption library in C/C++? Solutions like OpenSSL and Crypto++ are cross-platform, if you "didn't manage to make them work", you