sha

Creating a hash from several Java string objects

喜欢而已 提交于 2019-12-01 15:49:10
What would be the fastest and more robust (in terms of uniqueness) way for implementing a method like public abstract String hash(String[] values); The values[] array has 100 to 1,000 members, each of a which with few dozen characters, and the method needs to be run about 10,000 times/sec on a different values[] array each time. Should a long string be build using a StringBuilder buffer and then a hash method invoked on the buffer contents, or is it better to keep invoking the hash method for each string from values[] ? Obviously a hash of at least 64 bits is needed (e.g., MD5) to avoid

Creating a hash from several Java string objects

老子叫甜甜 提交于 2019-12-01 15:30:58
问题 What would be the fastest and more robust (in terms of uniqueness) way for implementing a method like public abstract String hash(String[] values); The values[] array has 100 to 1,000 members, each of a which with few dozen characters, and the method needs to be run about 10,000 times/sec on a different values[] array each time. Should a long string be build using a StringBuilder buffer and then a hash method invoked on the buffer contents, or is it better to keep invoking the hash method for

How does git assure that commit SHA keys for identical operations/data are still unique?

試著忘記壹切 提交于 2019-12-01 14:42:42
问题 If I create a file foo with touch foo and then run shasum foo it will print out da39a3ee5e6b4b0d3255bfef95601890afd80709 . No matter how often I run shasum foo or if I run it on a different computer it will always print da39a3ee5e6b4b0d3255bfef95601890afd80709 because, yep, it's the SHA1 representation of exactly the same contents. Empty contents in this case :) However, if I do the following steps: cd /some/where mkdir demo git init touch foo git add -A git commit -m "adding foo" ..and

Verify signature generated with RSA 2048-bit key, SHA256 algorithm and PKCSv1.5 padding

ぐ巨炮叔叔 提交于 2019-12-01 10:40:21
I have a UWA (Universal Windows Application) signing some data with the KeyCredential.RequestSignAsync method. The signature is created with: RSA 2048-bit key (public portion can be retrieved with KeyCredential.RetrievePublicKey ) Hashing algorithm used is SHA256 Padding used with the signature is PKCSv1.5 And can be validated in the same UWA with the following code: public static bool VerifySignature( IBuffer buffPublicKey, IBuffer buffMessageData, IBuffer buffSignature) { bool b = false; // Open the algorithm provider var algProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm

HMAC SHA1 Signature in Java

狂风中的少年 提交于 2019-12-01 09:23:21
I am trying to interface with a TransUnion web service and I need to provide a HMAC-SHA1 signature to access it. This example is in the TransUnion documentation: Input of SampleIntegrationOwner2008‐11‐18T19:14:40.293Z with security key xBy/2CLudnBJOxOtDhDRnsDYq9HTuDVr2uCs3FMzoxXEA/Od9tOuwSC70+mIfpjeG68ZGm/PrxFf/s/CzwxF4Q== creates output of /UhwvT/kY9HxiXaOjpIc/BarBkc= . Given that data and key, I cannot get this same result in Java. I have tried several online calculators, and none of them return this result either. Is the example in their documentation incorrect, or am I just not handling

SecretKeyFactory.getInstance(“PBKDF2WithHmacSHA512”) throws NoSuchAlgorithmException

浪尽此生 提交于 2019-12-01 09:13:05
After a little bit of research and some work I finally was able to hash salt the password now there is a question which is on my mind I have used the SHA1 method and I would like to try to use the SHA512 because I was told it's better (more secure) so the following is my code its a little bit all over the place but I think its comprehensible so: public class Safety { //calling some parameters for possible later changes public static final String algorithm = "PBKDF2WithHmacSHA1"; public static final int saltbytesize = 24; public static final int hashbytesize = 24; public static final int

SecretKeyFactory.getInstance(“PBKDF2WithHmacSHA512”) throws NoSuchAlgorithmException

跟風遠走 提交于 2019-12-01 07:18:25
问题 After a little bit of research and some work I finally was able to hash salt the password now there is a question which is on my mind I have used the SHA1 method and I would like to try to use the SHA512 because I was told it's better (more secure) so the following is my code its a little bit all over the place but I think its comprehensible so: public class Safety { //calling some parameters for possible later changes public static final String algorithm = "PBKDF2WithHmacSHA1"; public static

HMAC SHA1 Signature in Java

半城伤御伤魂 提交于 2019-12-01 06:49:03
问题 I am trying to interface with a TransUnion web service and I need to provide a HMAC-SHA1 signature to access it. This example is in the TransUnion documentation: Input of SampleIntegrationOwner2008‐11‐18T19:14:40.293Z with security key xBy/2CLudnBJOxOtDhDRnsDYq9HTuDVr2uCs3FMzoxXEA/Od9tOuwSC70+mIfpjeG68ZGm/PrxFf/s/CzwxF4Q== creates output of /UhwvT/kY9HxiXaOjpIc/BarBkc= . Given that data and key, I cannot get this same result in Java. I have tried several online calculators, and none of them

Fast and light JavaScript SHA-256 secure hash implementation [closed]

帅比萌擦擦* 提交于 2019-12-01 01:50:05
I'm looking for a hash implementation that is; secure (practically impossible to invert) fast (few ms) light (few KB) runs in the browser Ideally a SHA-256 implementation, since it is widely used and therefore widely tested against. Doing some tests suggests that forge is the fastest SHA-256 JavaScript implementation. It is 284KB big but extracting the SHA-256 related code reduces the size to 4.5 KB, see https://github.com/brillout/forge-sha256 . 来源: https://stackoverflow.com/questions/31219009/fast-and-light-javascript-sha-256-secure-hash-implementation

Which versions of Android support which package signing algorithms?

纵然是瞬间 提交于 2019-12-01 01:47:18
问题 Given that I want to support all android devices which are, say, Froyo or later, what's the most secure signing algorithm I can use? I do not need to place my APK in Android Market . I know, for instance, that some phones support sha1withrsa but not sha256withrsa (Link). 回答1: Please refer to the android dev guide on signing. The current default method is SHA1withRSA : $ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name while