sha1

PHP different one way hashes for password security

雨燕双飞 提交于 2019-12-05 03:39:17
问题 I was wondering to hash the password in PHP using different methods available and the combination of them for more and more security. I was wondering if this would work..? $pass = "***"; $salt = "!@)#%%@(#&@_!R151"; $pass = sha1($pass.$salt); $pass = md5($pass); 回答1: Rather than that, you can use a stronger hashing algorithm like sha512 with combination of a strong salt and UserID : Do it like this: echo hash('sha512', 'MyPassword' . $StrongSalt . $UserID); SHA512 is actually SHA-2 for which

How safely can I assume unicity of a part of SHA1 hash?

落花浮王杯 提交于 2019-12-05 02:41:39
I'm currently using a SHA1 to somewhat shorten an url: Digest::SHA1.hexdigest("salt-" + url) How safe is it to use only the first 8 characters of the SHA1 as a unique identifier, like GitHub does for commits apparently? To calculate the probability of a collision with a given length and the number of hashes that you have, see the birthday problem . I don't know the number of hashes that you are going to have, but here are some examples. 8 hexadecimal characters is 32 bits, so for about 100 hashes the probability of a collision is about 1/1,000,000, for 10,000 hashes it's about 1/100, for 100

Calculate SHA1 or MD5 hash in iReport

送分小仙女□ 提交于 2019-12-05 02:41:01
问题 How would one calculate an SHA1 or MD5 hash within iReport at report execution? I need to compare a pre-calculated hash against a database driven field (string). Using iReport 2.0.5 (Old) and Report Engine is embedded into a commercial application. 回答1: I used iReport and Jasper Reports some years ago and I don't remember the details, but I remember that you could put in some way Java code to be evaluated. Using that feature you could calculate the MD5 in few lines: String encryptionAlgorithm

Working algorithm for PasswordDigest in WS-Security php

女生的网名这么多〃 提交于 2019-12-05 02:34:38
问题 I have been creating hash password from the formula given by my airline supplier. I have search on this site and I got the solution from below link in C# but I want in PHP. Working algorithm for PasswordDigest in WS-Security I have tried like this in php but password digest which I am getting is wrong function getTimestamp() { $microtime = floatval(substr((string)microtime(), 1, 8)); $rounded = round($microtime, 3); return gmdate("Y-m-d\TH:i:s") . substr((string)$rounded, 1, strlen($rounded))

Does i need different SHA1 key to perform Google Map

淺唱寂寞╮ 提交于 2019-12-05 01:27:53
问题 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 (

SHA1 in Java and PHP with different results

最后都变了- 提交于 2019-12-05 00:51:28
问题 I know there are several questions like this around, but I tried every single solution I found on stackoverflow and I still haven't got the expected result. I'm trying to convert a string to sha1 in Java and PHP, but I'm getting different results. The string is generated randomly. I checked the string on both ends and they are the same (even trying a online comparison tool). This is the same code I use in another app and it's working there, but not in this case. One string I tried to hash

HMC SHA1 hash - Java producing different hash output than C#

牧云@^-^@ 提交于 2019-12-05 00:33:02
问题 This is a follow up to this question, but I'm trying to port C# code to Java instead of Ruby code to C#, as was the case in the related question. I am trying to verify the encrypted signature returned from the Recurly.js api is valid. Unfortunately, Recurly does not have a Java library to assist with the validation, so I must implement the signature validation myself. Per the related question above (this), the following C# code can produce the hash needed to validate the signature returned

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

谁说我不能喝 提交于 2019-12-05 00:24:58
问题 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

Is it possible to decrypt SHA1 [duplicate]

こ雲淡風輕ζ 提交于 2019-12-04 23:45:50
This question already has answers here : Is it possible to reverse a sha1? (9 answers) Closed 5 years ago . Is it possible to decrypt(retain the actual string) the password which is saved in db using SHA1 algorithm. Example:If password is "password" and it is stored in db as "sha1$4fb4c$2bc693f8a86e2d87f757c382a32e3d50fc945b24" ,is any chance to retain the same "password"(string) from "sha1$4fb4c$2bc693f8a86e2d87f757c382a32e3d50fc945b24" SHA1 is a cryptographic hash function, so the intention of the design was to avoid what you are trying to do. However, breaking a SHA1 hash is technically

Is there an equivalent to SHA1() in MS-SQL?

♀尐吖头ヾ 提交于 2019-12-04 22:14:48
Converting a couple stored procedures from MySQL to Microsoft SQL server. Everything is going well, except one procedure used the MySQL SHA1() function. I cannot seem to find an equivalent to this in MS-SQL. Does anyone know a valid equivalent for SHA1() on MS-SQL? SQL Server 2005 and later has the HashBytes() function. If you want to get a SHA1 hash exactly as MySQL would generate it (i.e. as a varchar), you can combine HashBytes with sys.fn_varbintohexsubstring. E.g. SELECT sys.fn_varbintohexsubstring(0, HashBytes('SHA1', 'password'), 1, 0) See http://accessrichard.blogspot.co.nz/2010/12/sql