sha1

How can I pass git SHA1 to compiler as definition using cmake?

爱⌒轻易说出口 提交于 2019-12-28 01:43:45
问题 In a Makefile this would be done with something like: g++ -DGIT_SHA1="`git log -1 | head -n 1`" ... This is very useful, because the binary knows exact commit SHA1 so it can dump it in case of segfault. How can I achieve the same with CMake? 回答1: I've made some CMake modules that peer into a git repo for versioning and similar purposes - they're all in my repository at https://github.com/rpavlik/cmake-modules The good thing about these functions is, they will force a re-configure (a rerun of

Can't get SHA-1 fingerprint from signature.jks

冷暖自知 提交于 2019-12-25 07:11:07
问题 i have a huge problem: i don't know how to get the SHA-1 fingerprint from the file that i use to sign my app. Let's assume that my jks file (generated from Android Studio) is named "signature.jks". How can i get the SHA-1 fingerprint? I tried with this syntax: C:\Program Files\Java\jdk1.7.0\bin>keytool -list -v -keystore E:\apkname.keystore -alias apkname Where "apkname" is the name of the apk and "E" is the disk where my jks file is stored. Unfortunately it doesn't work. Can someone help me?

mysql sha1 encryption for whole password column

十年热恋 提交于 2019-12-25 04:24:08
问题 I have a table in phpmyadmin containing the username and password, but the password field isn't encrypted. I wanted to encrypt the whole column of the password field into SHA1 format. Any idea how to do so? 回答1: First, please read How to securely hash passwords?. Then you can look for a PHP PBKDF2, Bcrypt, or Scrypt implementation to use. In the database, you'll want: A column for the salt - perhaps BINARY(16) for a 128 bit salt. See What is the correct way to make a password salt? - Adnan's

Encryption using SHA1

匆匆过客 提交于 2019-12-25 02:26:32
问题 I am developing a large application and i need encryption when a data is traveling between two machines in different continents. I have never worked on encryption. I want a simple encryption which can be handled in PHP / Ruby / Python without any dependencies. So i decided to use HMAC SHA1. $pad=hash_hmac("sha1","The quick brown....","mykey"); This is what i found out after some research on the internet. How hard it is to decrypt it if someone doesn't know the key? Also, any alternatives to

Library not loaded (libcrypto)

£可爱£侵袭症+ 提交于 2019-12-25 00:38:05
问题 After updating ruby and rubyenv packages I'm facing an error. The libcrypto library is not loaded. When executing the suggested command it seems that it is searching for openssl in ruby /Users/User/.rvm/rubies/ruby-2.4.1 . But on my system I use /usr/local/Cellar/ruby/2.6.5 . $ gem pristine executable-hooks --version 1.3.2 Error loading RubyGems plugin "/Users/User/.rvm/gems/ruby-2.4.1@global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": dlopen(/Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2

Simulating MySql's PASSWORD() encryption using .NET in Windows 8

心不动则不痛 提交于 2019-12-24 14:15:26
问题 PASSWORD() according to MySQL documentation is a double SHA1 algorithm. In Win32 I was using this method: public string GenerateMySQLHash(string key) { byte[] keyArray = Encoding.UTF8.GetBytes(key); SHA1Managed enc = new SHA1Managed(); byte[] encodedKey = enc.ComputeHash(enc.ComputeHash(keyArray)); StringBuilder myBuilder = new StringBuilder(encodedKey.Length); foreach (byte b in encodedKey) myBuilder.Append(b.ToString("X2")); return "*" + myBuilder.ToString(); } SHA1Managed object is not

RSA Signing using MD5-SHA1 Hash Algorithm

时光毁灭记忆、已成空白 提交于 2019-12-23 19:06:14
问题 From what I can tell, TLS 1.1 requires the contents of the CertificateVerify message to be a digitally signed value using the concatenation of two hash algorithms (MD5 and SHA1). Is this possible to do in .NET using the RSACryptoServiceProvider? This does not work: using (var rsa = new RSACryptoServiceProvider()) { rsa.ImportParameters(...); rsa.SignData(data, new MD5SHA1()); } This also does not work: using (var rsa = new RSACryptoServiceProvider()) { rsa.ImportParameters(...); rsa.SignHash

Why is my SHA1 hash not matching?

99封情书 提交于 2019-12-23 17:26:32
问题 I don't think I was specific enough last time. Here we go: I have a hex string: 742713478fb3c36e014d004100440041004 e0041004e00000060f347d15798c9010060 6b899c5a98c9014d007900470072006f007 500700000002f0000001f7691944b9a3306 295fb5f1f57ca52090d35b50060606060606 The last 20 bytes should (theoretically) contain a SHA1 Hash of the first part (complete string - 20 bytes). But it doesn't match for me. Trying to do this with PHP, but no luck. Can you get a match? Ticket: 742713478fb3c36e014d004100

how to store password salt

大城市里の小女人 提交于 2019-12-23 09:34:20
问题 I've seen various methods on how to properly salt a password. The basic premise is that you attach a random string to each password before it is hashed and stored. Can I store the salt in the same table as the password? Also, does it matter if the salt is stored as plain text, as long as each entry has a different salt? 回答1: Yes. The idea behind a salt is not that the salt be secret, but that it causes the same password for different users to be hashed differently. This raises the size of

Why does Git use the SHA1 of the *compressed* objects rather than the SHA1 of the original objects?

≯℡__Kan透↙ 提交于 2019-12-23 07:16:34
问题 I'm just curious as to why this choice was made - it basically rules out changing the compression algorithm used by Git - because it doesn't use the SHA1 of the raw blobs. Perhaps there is some efficiency consideration here. Maybe ZLIB is faster at compressing a file than the SHA1 algorithm is at creating the hash, so therefore compressing before hashing is faster? Here is a link to the original Git READMEby Linus: http://git.kernel.org/?p=git/git.git;a=blob;f=README;h