md5

Are the first 32 bits of an md5 hash just as “random” as any other substring?

浪子不回头ぞ 提交于 2019-11-30 17:56:54
I'm looking to create a 32-bit hash of some data objects. Since I don't feel like writing my own hash function and md5 is available, my current approach is to use the first 32 bits (i.e. first 8 hex digits) from an md5 hash. Is this acceptable? In other words, are the first 32 bits of an md5 hash just as "random" as any other substring? Or is there any reason I'd prefer, say, the last 32 bits? or perhaps XOR'ing the four 32-bit substrings together? Some preemptive clarifications: These hashes don't need to be cryptographically secure. I'm not concerned with the performance of md5--it is more

Calculate multiple checksums from the same InputStream using DigestInputStream

三世轮回 提交于 2019-11-30 16:04:06
I am trying to figure out how to read multiple digests (md5, sha1, gpg) based on the same InputStream using DigestInputStream . From what I've checked in the documentation, it seems to be possible by cloning the digest. Could somebody please illustrate this? I don't want to be re-reading the stream in order to calculate the checksums. Louis Wasserman You could wrap a DigestInputStream around a DigestInputStream and so on recursively: DigestInputStream shaStream = new DigestInputStream( inStream, MessageDigest.getInstance("SHA-1")); DigestInputStream md5Stream = new DigestInputStream( shaStream

How do I get the hash of current .exe?

落花浮王杯 提交于 2019-11-30 15:54:43
问题 [SOLVED] : I copied the file and ran the hasher on that copy. I need my app to find the EXE's current MD5. I can get the MD5 of any file. However, no matter what I do, I cannot get a FileStream to read the open EXE. I tried using FileOptions.Asynchronous but that didn't help. EDIT: I guess I'm not very clear. I want my app to be be able to read itself. EDIT to code: private void GetMd5() { MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); FileInfo fi = new FileInfo(Process

How do I get the hash of current .exe?

被刻印的时光 ゝ 提交于 2019-11-30 15:37:54
[SOLVED] : I copied the file and ran the hasher on that copy. I need my app to find the EXE's current MD5. I can get the MD5 of any file. However, no matter what I do, I cannot get a FileStream to read the open EXE. I tried using FileOptions.Asynchronous but that didn't help. EDIT: I guess I'm not very clear. I want my app to be be able to read itself. EDIT to code: private void GetMd5() { MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); FileInfo fi = new FileInfo(Process.GetCurrentProcess().MainModule.FileName); FileStream stream = File.Create(Process.GetCurrentProcess()

Wordpress MD5 Password

烂漫一生 提交于 2019-11-30 15:07:39
I need to insert users into a Wordpress blog via a PHP script or MySQL, and I have a plain text password. I thought I could do something like this: $query = "INSERT INTO $new_db.wp_users (user_login, user_pass, user_nicename) select user_email, md5(user_password), user_name from $source_db.users"; But the passwords all look different from what the Wordpress passwords look like now. All the passwords all start with $P$B From reading it says there is a salt... is there a way to take a password like test123 and turn it into the encrypted password that Wordpress expects? The most sensible solution

installing python packages have issue in md5

一世执手 提交于 2019-11-30 14:25:16
问题 I'm using Windows and when I want Install packages I got below error: pip install django Requirement already satisfied (use --upgrade to upgrade): django in c:\python27\lib\site-packages C:\code\Djangotest\amar-e-simples-master>pip install django --upgrade Collecting django Downloading Django-1.9.7-py2.py3-none-any.whl (6.6MB) 6% |# | 399kB 3.3MB/s eta 0:00:02 THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes.

iPhone: fast hash function for storing web images (url) as files (hashed filenames)

拟墨画扇 提交于 2019-11-30 14:15:56
问题 What is a fast hash function available for the iPhone to hash web urls (images)? I'd like to store the cached web image as a file with a hash as the filename, because I suppose the raw web url could contain strange characters that could cause problems on the file system. The hash function doesn't need to be cryptographic, but it definitely needs to be fast. Example: Input: http://www.calumetphoto.com/files/iccprofiles/icc-test-image.jpg Output: 3573ed9c4d3a5b093355b2d8a1468509 This was done

Securely hash passwords - so much conflicting advice!

十年热恋 提交于 2019-11-30 14:09:34
I'm reading so much conflicting advice as to how to store passwords securely. All I know for sure is not to use MD5! I've seen people advocate using PHP's bcrypt function, which seems like it'd hog the server's processor. I've seen advocates for salts, and advocates for not using salts. It's all just so unclear. Is there real and credible advice as to how to store passwords securely? Edit: After a fair amount of research, I found an article from ;login: that deals with the topic in quite some depth: http://www.usenix.org/publications/login/2004-06/pdfs/alexander.pdf Well, there is several

Encrypting(MD5) multiple times can improve security?

走远了吗. 提交于 2019-11-30 13:53:07
I saw some guy who encrypt users password multiple times with MD5 to improve security. I'm not sure if this works but it doesn't look good. So, does it make sense? Let's assume the hash function you use would be a perfect one-way function. Then you can view its output like that of a "random oracle" , its output values are in a finite range of values (2^128 for MD5). Now what happens if you apply the hash multiple times? The output will still stay in the same range (2^128). It's like you saying "Guess my random number!" twenty times, each time thinking of a new number - that doesn't make it

Convert MD5 to base62 for URL

早过忘川 提交于 2019-11-30 13:22:01
问题 I have a script to convert to base 62 (A-Za-z0-9) but how do I get a number out of MD5? I have read in many places that because the number from an MD5 is bigger than php can handle as an integer it will be inaccurate... As I want a short URL anyway and was not planning on using the whole hash, maybe just 8 characters of it.... So my question is how to get part of the number of an MD5 hash? Also is it a bad idea to use only part of the MD5 hash? 回答1: I'm going to suggest a different thing here