sha

linker error with openssl (trying SH1 example)

纵饮孤独 提交于 2019-12-11 02:39:26
问题 I'm trying to compile an example of how to implement SHA1 but I keep getting this error: [Linker Error] Unresolved external '_SHA1' referenced from C:\PROGRAM FILES (X86)\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ I downloaded openssl files from their website, I tried both copying the headers directory to my project directory and copying it to my includes directory, but nothing. here's the example code: #include <string.h> #include <openssl/sha.h> #include <stdio.h> int main(int argc, char* argv[])

Adaptation of SHA2 512 gives incorrect results

筅森魡賤 提交于 2019-12-11 01:18:49
问题 I am trying to adapt the pure Lua implementation of the SecureHashAlgorithm found here for SHA2 512 instead of SHA2 256. When I try to use the adaptation, it does not give the correct answer. Here is the adaptation: -- -- UTILITY FUNCTIONS -- -- transform a string of bytes in a string of hexadecimal digits local function str2hexa (s) local h = string.gsub(s, ".", function(c) return string.format("%02x", string.byte(c)) end) return h end -- transforms number 'l' into a big-endian sequence of

Decrypt SHA1 with (password) in python

自古美人都是妖i 提交于 2019-12-11 00:55:20
问题 I have a function for encrypting with SHA-1 in Python, using hashlib . I take a file and encrypt the contents with this hash. If I set a password for an encrypted text file can I use this password to decrypt and to restore the file with the original text? 回答1: Hashing functions are different than normal crypto algorithms. They are oftenly referred to as one-way ciphers, because the process data goes through is irreversible. Differently than symmetric and assymetric encryption, hashes are used

Is binary hashing possible with CryptoJS?

做~自己de王妃 提交于 2019-12-10 19:06:02
问题 I want to create an HOTP client using javascript similar to SpeakEasy The above library is intended for server side javascript usage and it uses NodeJS. I want to do the same thing on front end javascript in a browser but I haven't been able to use CryptoJS to achieve this behavior. var key = "abc"; var counter = "123"; // create an octet array from the counter var octet_array = new Array(8); var counter_temp = counter; for (var i = 0; i < 8; i++) { var i_from_right = 7 - i; // mask 255 over

Does a git commit hash equal a repository state?

假如想象 提交于 2019-12-10 15:56:37
问题 Each git commit is attributed a hash which "signs" its content. Does it also sign where the commit came from or is it just the commit data itself which is used for the hash calculation? Differently phrased: is it impossible (apart from hash collisions) to forge a second repository with its head commit having the exact same hash and same content but the rest of the tree differing? 回答1: The answer to the second question is yes (it is impossible, etc). The first question is not as well formed as

Hashing text with SHA-256 at Windows Forms

落爺英雄遲暮 提交于 2019-12-10 10:35:43
问题 String inputPass = textBox2.Text; byte[] inputBytes = System.Text.Encoding.UTF8.GetBytes(inputPass); byte[] inputHashedBytes = Sha256.ComputeHash(inputBytes); String inputHash = Convert.ToBase64String(inputHashedBytes); I'm getting some strange output: Q9nXCEhAn7RkIOVgBbBeOd5LiH7FWFtDFJ22TMLSoH8= By output hash looks like this: 43d9d70828409fb46420e56005b05e38de4b887ec5585b43149db64cc2d2a07f 回答1: // this is where you get the actual binary hash byte[] inputHashedBytes = Sha256.ComputeHash

Code example for C# and Javascript SHA256 hashing

左心房为你撑大大i 提交于 2019-12-10 10:04:14
问题 I have an algorithm in C# running on server side which hashes a base64-encoded string. byte[] salt = Convert.FromBase64String(serverSalt); // Step 1 SHA256Managed sha256 = new SHA256Managed(); // Step 2 byte[] hash = sha256.ComputeHash(salt); // Step 3 Echo("String b64: " + Convert.ToBase64String(hash)); // Step 4 The hash is then checked against a database list of hashes. I'd love to achieve the same with javascript, using the serverSalt as it is transmitted from C# through a websocket. I

Password Hashing - Why salt 60,000 times

瘦欲@ 提交于 2019-12-10 06:31:37
问题 I'm working for a Fortune 100 company and I'm thrown into being tasked with security moving from SHA1 to SHA-2 . This is not my area of expertise, but as I study cryptography I am questioning the outdated information etc... SHA-2 is obviously needed over SHA-1 but when the security team KNOWS that the hashing of password + salt is using SHA, with GPU being so ridiculously fast at cracking billions of hashes - I do not get why for passwords i'm not being told to use bcrypt or another

PBKDF2 recommended key size?

点点圈 提交于 2019-12-09 23:39:12
问题 My function is as follows: pbkdf2($raw_pw,$salt,1000,128) 1000 is the number of passes, and 128 is the key size. The function returns a binary key which I use base64 to store it in the database. My question is: what's the recommended keysize and salt size for pbkdf2 using sha512? will a keysize of 32 be just as secure as a keysize of 128? 回答1: 1000 is the number of iterations, not passes. 128 Is the length at the end. According to Wikipedia (and my own little knowledge about cryptography) you

Can't get to have SHA-256 hash working with my spring security

梦想与她 提交于 2019-12-09 07:57:03
问题 I am using the Spring Roo framework which uses Spring Security as security framework. I configured it the following way: <authentication-manager alias="authenticationManager"> <!-- SHA-256 values can be produced using 'echo -n your_desired_password | sha256sum' (using normal *nix environments) --> <authentication-provider> <password-encoder hash="sha-256"> <!-- <salt-source user-property="login"/> --> </password-encoder> <jdbc-user-service data-source-ref="dataSource" users-by-username-query=