hash

How to send password securely via HTTP using Javascript in absence of HTTPS?

The very basic issue all developers face: Whenever user submits the form, the password is sent via network and it must be protected. The site I develop for doesn't have HTTPS. Neither does the owner want to buy a SSL certificate, nor is he interested in a self-signed one. So I want to protect the password sent via HTTP using Javascript w...

Why would I return a hash or a hash reference Perl?

Hi I was wondering what the most effective way of accomplishing the below would be. ( i know they accomplish the same thing but was wondering how most people would do this between the three, and WHY ) a.pl my %hash = build_hash(); # do stuff with hash using $hash{$key} sub build_hash { # build some hash my %hash = (); my @...

What decides the order of keys when I print a Perl hash?

Hi, activePerl 5.8 based #!C:\Perl\bin\perl.exe use strict; use warnings; # declare a new hash my %some_hash; %some_hash = ("foo", 35, "bar", 12.4, 2.5, "hello", "wilma", 1.72e30, "betty", "bye\n"); my @any_array; @any_array = %some_hash; print %some_hash; print "\n"; print @any_array; print "\n"; print $any_array[0]; print "\...

duplicating the md5 raw_output flag (raw bytes) in PHP 5 with Ruby's md5

Due to an absurd SOAP authentication scheme I need to md5 hash an API key with some other parameters. Unfortunately the only sample code provided is written in PHP and, for reasons I find unfathomable, it requires that the md5 hashing use the optional raw_output flag in PHP (http://php.net/manual/en/function.md5.php) which causes it to ...

How do I create an MD5 Hash of a string in Cocoa?

I know SHA-1 is preferred, but this project requires I use MD5. #include <openssl/md5.h> - (NSString*) MD5Hasher: (NSString*) query { NSData* hashed = [query dataUsingEncoding:NSUTF8StringEncoding]; unsigned char *digest = MD5([hashed bytes], [hashed length], NULL); NSString *final = [NSString stringWithUTF8String: (char *)...

Automatic Clustering With Hash/Map of Vectors in C++

I have the following values for example: 0 0 0 1 3 2 These values refers to cluster Ids, where the member of the cluster is the index of the vector. Hence we want to get this sort of output: Cluster 0 -> 0,1,2 Cluster 1 -> 3 Cluster 2 -> 5 Cluster 3 -> 4 I tried the following construct but it doesn't seem to work: What's the way t...

Why do some sites have a md5 string on each file?

On some sites, in their download section each file has a md5. md5 of what? i cant understand the purpose on phpBB.com for example: Download phpBB 3.0.6 (zip) Size: 2.30 MiB MD5: 63e2bde5bd03d8ed504fe181a70ec97a ...

Using a hash of data as a salt

I was wondering - is there any disadvantages in using the hash of something as a salt of itself? E.g. hashAlgorithm(data + hashAlgorithm(data)) This prevents the usage of lookup tables, and does not require the storage of a salt in the database. If the attacker does not have access to the source code, he would not be able to obtain the...

How do I create a hash in Ruby that compares strings, ignoring case?

In Ruby, I want to store some stuff in a Hash, but I don't want it to be case-sensitive. So for example: h = Hash.new h["HELLO"] = 7 puts h["hello"] This should output 7, even though the case is different. Can I just override the equality method of the hash or something similar? Thanks. ...

How do I make a shallow copy of a Perl hash reference?

I want to push a reference to a hash. By that I mean I want to push a reference to a new hash that is a shallow copy of the hash I am given. How do I create the shallow copy? ...

question about salt

How much stronger would this be: return sha1($salt.sha1($passwd)); compared to just: return sha1($salt.$passwd); salt is a per-user strong 12 char with random ascii ...

using sha256 as hashing and salting with user's ID

I'm gonna use sha256 for my site,to secure my users passwords,and as salt i was thinking of usings the users id (int auto_increment). that will be unique but not very long and hard,and public(user.php?id=1) but it just matters if its unique right? hash('sha256', $id . $password); have a nice day ...

How to check two hashed passwords are the same?

Hello, I'm writing a program where I use MD5 to hash login details before I send them to a server, but there I have to compare it to a blowfish (jBCrypt) hashed password retrieved from a database. jBCrypt uses: if (BCrypt.checkpw("candidatePassword", hashedPwd)) { // they are the same } The problem is that, I don't have a candidate ...

Bash syntax question: variable in brackets {} with # comments?

I just saw some code in bash that I didn't quite understand. Being the newbie bash scripter, I'm not sure what's going on. echo ${0##/*} echo ${0} I don't really see a difference in output in these two commands (prints the script name). Is that # just a comment? and what's with the /*. If it is a comment, how come it doesn't int...

What is the true difference between a dictionary and a hash table?

I've always used dictionaries. I write in Python. ...

What is being encrypted when I use a salted CRYPT_MD5 to encrypt my password?

Using md5 on a string always produces an alpha-numeric encrypted result, ie: no symbols. However, when I using the php crypt() function, specifically the CRYPT_MD5 (and it is on, I've checked) with a salt, the supposed md5 hash it returns does not look like an md5 hash. For example: if I md5 the string 'password', I get: $pass = md5(...

Where can I find source or algorithm of Python's hash() function?

>>> hash("\x01") 128000384 >>> hash("\x02") 256000771 >>> hash("\x03") 384001154 >>> hash("\x04") 512001541 Interesting part is 128000384 x 2 is not 256000771, and also others I am just wondering how that algorithm works and want to learn something on it. Thanks in advance. ...

SHA-1 google blob app engine

I can see the SHA-1 of my blobs in the datastore viewer on live google app engine. Is there a recommended way I can access the SHA-1 hash (or any other hash) of a blob programmatically in GAE? ...

Ruby gsub problem when using backreference and hashes.

The following code defines a hash with regular expressions (keys) and replacements (values). Then it iterates over the hash and replaces the string accordingly. Simple string substitution works well, but when I need to compute the resut before substituting it (the case of years to days change), it does not. And it is key that the hash ...

Possible to identify hash type?

I know you can compare the length but many hash types have the same lengths. So with just knowing that it is a hash is there a way to identify the type and also if its salted? example of the hash that I am working with is: hash=2bf231b0e98be99a969bd6724f42a691 hash=4ac5a4ff764807d6ef464e27e4d1bee3 hash=4d177cec31d658ed22cc229e45d7265e...