md5

PHP - Get the md5 of remote file?

主宰稳场 提交于 2019-12-30 10:27:49
问题 Is it possible to get the md5 of a file on a remote server? If so how? 回答1: how about md5_file("http://remotelocation/file") 回答2: It's not possible without downloading it, or the remote server providing the information (web service, HTML page, etc.) You can use md5(file_get_contents("http://remotelocation/file")) to download the file and calculate the md5 hash if your PHP installation is configured to open remote streams. But that will download the complete file. 回答3: Well depends what you

Best practices for efficiently storing md5 hashes in mysql

廉价感情. 提交于 2019-12-28 11:58:06
问题 Possible field types: BINARY(16) CHAR(32) BIGINT + BIGINT How do I decide which one to use? 回答1: If the column is indexed and you know what you're doing, BINARY(16) for performance reasons. Otherwise, CHAR(32) is fine. Make sure the column uses the ascii charset though. ( ascii_bin for example) 来源: https://stackoverflow.com/questions/2326584/best-practices-for-efficiently-storing-md5-hashes-in-mysql

MD5 hash with different results

耗尽温柔 提交于 2019-12-28 05:58:56
问题 Im trying to encode some chains to MD5 but I have noticed that: For the chain: "123456çñ" Some webs like http://www.md5.net www.md5.cz md5generator.net return: "66f561bb6b68372213dd9768e55e1002" And others like: http://www.adamek.biz/md5-generator.php 7thspace.com/webmaster_tools/online_md5_encoder.html md5.rednoize.com/ return: "9e6c9a1eeb5e00fbf4a2cd6519e0cfcb" I'd need to encode the chains with standar md5 because I need to connect my results with other systems. which hash is the correct?

What is the best way to create a random hash/string?

北战南征 提交于 2019-12-28 05:04:08
问题 What is the best way of generating a hash for the purpose of storing a session? I am looking for a lightweight, portable solution. 回答1: You can use PHP's built-in hashing functions, sha1 and md5. Choose one, not both. One may think that using both, sha1(md5($pass)) would be a solution. Using both does not make your password more secure, its causes redundant data and does not make much sense. Take a look at PHP Security Consortium: Password Hashing they give a good article with weaknesses and

Simple username and password validation java

北战南征 提交于 2019-12-25 08:57:12
问题 I am attempting to create my first login page as a learning exercise. My plan was to pre hash the password using a salt of the username for example. Store that in a text file and then when when the user logs in i would hash the password using the same salt and compare the results to the text file. I am a complete beginner with security etc so i dont know if this would be secure or not? What is the norm for small applications? if this method isnt recommended, what is a suitable simple

Having security in API System | PHP cuRL

瘦欲@ 提交于 2019-12-25 08:49:36
问题 I have made a API script for my website, so people can login from another website. It's using PHP cuRL to POST data to my website. I'm using a api key (md5 hash of the website) to verify the website with my MySQL database. But when someone is using my API Client (PHP cURL), they also can save the username's and passwords of my user's. How can i prevent this? 回答1: You might want to consider using OAuth. It's designed for exactly what you want to do. 回答2: I someone is typing their username and

Compare directories and sub directories and replace files based on MD5 hash

99封情书 提交于 2019-12-25 08:34:35
问题 Have a comparison script that compares based on MD5 hash. Noticed that it's doing odd things. $Source= "D:\Folder1" $Destination = "D:\folder2" get-childitem $Source -Recurse | foreach { #Calculate hash using Algorithm MD5 reference http://www.tomsitpro.com/articles/powershell-file-hash-check,2-880.html Write-Host "Copying $($_.fullname) to $Destination" -ForegroundColor Yellow $OriginalHash = Get-FileHash -Path $_.FullName -Algorithm MD5 #Now copy what's different $replacedfile = $_ | Copy

how do i find a hash for a chunk of file without having to save the chunk in a separate file?

倾然丶 夕夏残阳落幕 提交于 2019-12-25 07:26:57
问题 I want to find a hash for a chunk of file and save that hash in another file. I want to do it directly without having to save the chunk in a separate file.. here is my program. Const chunksize = 1024000000 dim istream,ostream Sub WriteChunk(data) Set oStream = CreateObject("ADODB.Stream") oStream.Open oStream.Type = 1 oStream.Write data Dim WshShell, oExec, input,objfile2,str1 Set WshShell = CreateObject("WScript.Shell") Set oExec = WshShell.exec("C:\Users\Administrator\desktop\experimenting

How can I get a SQL Server md5 hash to match a previous php md5 hash?

故事扮演 提交于 2019-12-25 06:46:35
问题 I have a SQL Server 2014 table filled with MD5 hashses generated by php using the php $hash = md5($password); command. Now that we are moving to a tighter security model, I would like to be able to within a Stored Procedure take a password and match it to the previously stored md5 hash. Problem comes when the md5 hash returned by SQL is different than the one returned by php. When I use SELECT username, [password], master.sys.fn_varbintohexsubstring(0, HASHBYTES('MD5', CONVERT(VARCHAR(32),

Take most significant 8 bytes of the MD5 hash of a string as a long (in Ruby)

三世轮回 提交于 2019-12-25 03:22:00
问题 Hey Friends, I'm trying to implement a java "hash" function in ruby. Here's the java side: import java.nio.charset.Charset; import java.security.MessageDigest; /** * @return most significant 8 bytes of the MD5 hash of the string, as a long */ protected long hash(String value) { byte[] md5hash; md5hash = md5Digest.digest(value.getBytes(Charset.forName("UTF8"))); long hash = 0L; for (int i = 0; i < 8; i++) { hash = hash << 8 | md5hash[i] & 0x00000000000000FFL; } return hash; } So far, my best