md5

AES encryption & security flaw

不打扰是莪最后的温柔 提交于 2019-12-03 21:57:52
Check update#1 This logic is a candidate for a authentication procedure, done by simple HTTP requests: I'm sending: userName + encrypted_userName (encrypted_userName is actually the encrypted result of userName, done using AES & as key i use the md5 hash of the password). NOTE: I'm not sending the md5 hashed Password. on the server I'm comparing: encrypted_userName with own_encrypted_userName (since on server i have access to full info on user, i calculate own encrypted_userName). Question : is this a security flaw? Say bad guy captures full HTTP request, can he extract password from this 2

nodejs crypto module, does hash.update() store all input in memory

淺唱寂寞╮ 提交于 2019-12-03 21:49:23
问题 I have an API route that proxies a file upload from the browser/client to AWS S3. This API route attempts to stream the file as it is uploaded to avoid buffering the entire contents of the file in memory on the server. However, the route also attempts to calculate an MD5 checksum of the file's body. As each part of the file is chunked, the hash.update() method is invoked w/ the chunk. http://nodejs.org/api/crypto.html#crypto_hash_update_data_input_encoding var crypto = require('crypto'); var

How to transform phrases and words into MD5 hash?

隐身守侯 提交于 2019-12-03 21:41:38
Can anyone, please, explain to me how to transform a phrase like "I want to buy some milk" into MD5? I read Wikipedia article on MD5, but the explanation given there is beyond my comprehension: "MD5 processes a variable-length message into a fixed-length output of 128 bits. The input message is broken up into chunks of 512-bit blocks (sixteen 32-bit little endian integers)" "sixteen 32-bit little endian integers" is already hard for me. I checked the Wiki article on little endians and didn't understand a bit. However, the examples of some phrases and their MD5 hashes in that Wiki article are

How to get MD5 hash from string in SWIFT and make bridge-header

只愿长相守 提交于 2019-12-03 21:14:27
i dont even expect this problem, but it appears. I try to get md5 hash from string in swift. I search about that on SO and assume that i need to import library like that: #import <CommonCrypto/CommonCrypto.h> First of all compiler said that '#' is not okay. Then i removed and compiler said that '<' is not okay. I tried to figure out that and find recommendations to add folder named "CommonCrypto" and create a file named "module.map". I cant understand how to create file with this extension. Okay, i create swift file and replace its extension. Then write code there: module CommonCrypto [system]

PHP different one way hashes for password security

不羁岁月 提交于 2019-12-03 21:13:33
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); 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 there are no collisions found. See at wikipedia . Nope. Combinations do not add any security. Actually you

Java MessageDigest doesn't work

假如想象 提交于 2019-12-03 21:05:52
I can't make MessageDigest work, the program gives me two error: UnsupportedEncodingException, NoSuchAlgorithmException byte[] bytesOfchat_key = "lol".getBytes("UTF-8"); MessageDigest md = MessageDigest.getInstance("MD5"); byte[] Digest = md.digest(bytesOfchat_key); If I throw the errors, it give me ワ￟ᄡ9ᅦヌnp>0xd￉z as response ( 16 chars ) PS: I have used to print the Digest for (byte b : Digest) { System.out.print((char)b); } md5 returns hexadecimal numbers, so for decoding it to a String you could use String plaintext = "lol"; MessageDigest m = MessageDigest.getInstance("MD5"); m.reset(); m

Performance issues when looping an MD5 calculator on many files

房东的猫 提交于 2019-12-03 20:14:40
I'm creating a program that checks files by comparing their MD5s to a DB of already checked MD5s. It loops through thousands of files, and I see that it uses a lot of memory. How can I make my code as efficient as possible? for (File f : directory.listFiles()) { String MD5; //Check if the Imagefile instance is an image. If so, check if it's already in the pMap. if (Utils.isImage(f)) { MD5 = Utils.toMD5(f); if (!SyncFolderMapImpl.MD5Map.containsKey(MD5)) { System.out.println("Adding " + f.getName() + " to DB"); add(new PhotoDTO(f.getPath(), MD5, albumName)); } } And this is toMD5: public static

Salting a C# MD5 ComputeHash on a stream

无人久伴 提交于 2019-12-03 20:13:49
I can't see any way to salt a MD5.ComputeHash(Stream). Am I missing some way of injecting bytes into the HashAlgorithm? I tried performing a ComputeHash(byte[]) before performing the stream compute, but, unsurprisingly, it had no effect. Any ideas (apart from modifying the file)? Thanks for your time. addendum Just to be a little more specific, I want to use a stream to get a hash on a large file that I don't want to load into memory. FileInfo myFI= new FileInfo("bigfile.dat"); FileStream myIFS = piFile.OpenRead(); MD5 md5 = MD5.Create(); byte[] hash = md5.ComputeHash ( myIFS ); myIFS.Close ()

Is there a MD5 library that doesn't require the whole input at the same time?

两盒软妹~` 提交于 2019-12-03 17:48:02
问题 I'm working on Objective C Cocoa application. I tested CC_MD5 in CommonCrypto, and it worked just fine; however, when I gave 5 gygabyte file to it, my whole computer froze and crashed. MD5 algorithm processes input as 512-byte chunks and doesn't really require all the input at once. Is there an library in Objective C or C that asks for next 512-byte chunk instead of taking all input at once? 回答1: There is a great thread on calculating MD5 of large files in obj-C here: http://www.iphonedevsdk

What is better? Password_hash vs. SHA256 vs. SHA1 vs. md5

守給你的承諾、 提交于 2019-12-03 17:35:40
问题 What is better with salt for password storage? MD5: $hash = md5($password . $salt); Password_hash: $hash = password_hash($password, PASSWORD_DEFAULT, $salt); SHA1: $result = sha1($salt.$string); 回答1: You should absolutely use the password_hash() function without providing your own salt: $hash = password_hash($password, PASSWORD_DEFAULT); The function will generate a safe salt on its own. The other algorithms are ways too fast to hash passwords and therefore can be brute-forced too easily