A list of puns related to "Trivial Hash Function"
Hello,
For a graduate school project, I'm crafting the Neural Network that I briefly talked about in the title. I've been working on it for a while. This might sound contradictory, but I'm very happy with how I've designed my code... although it does not train the weights correctly. I'm unsure as to why it doesn't. I'm able to customize the amount of nodes in each layer, and amount of layers in the program to be whatever I wish and it will compute an answer. But the answer is always off. I believe the answer to be something that I am structurally not understanding about the Sigmoid activation function, or gradient descent, and fixing the issue won't be something that fundamentally changes how my program is designed algorithmically.
Anyway, I'm asked to have a training set as an input, as well as "correct output", since this is supervised learning (the correct output being very simple, 2*x, where x is the input) that will train the weights around said function. It will not work for the life of me. For example, with an epoch of 50000, ill input data points between 0 and .5, with all of the output values being double that (since the function is 2x, so they will all be between .5 and 1). The final output will be nowhere close to correct, and the weights aren't trained as they should. I believe it to be because the task I've been given might not be entirely possible, I'm interpreting the output data wrong, or the training set I'm using is bad. my advisor wants me to use this activation function to do this task, and I don't want to disappoint.
I'd be more than happy to give more details should someone ask for clarification. Apologies if my post isn't worded too well. Thank you.
Let A_0 and A_1 be two 256x256 invertible random matrices over Z/2Z. Let H_i be the value of the hash after parsing the ith bit. Start with H_0 = (1,0,0,...,0). Let M_i be the ith bit of the message. For each bit of the message, we compute H_i = A_(M_i)H_(i-1).
Hash functions are usually super complicated, so I like how simple this procedure is. But performances are disastrous, this doesn't seem practical at all. Do you think you can find a way to produce a collision?
sin(x) is bounded, and continuous and periodic but it's fairly trivial. In fact I would consider any trig function fairly trivial.
My favorite example is
The sum from n=-infinity to infinity of exp(-(x+n)^2 ). It's periodic, non trivial continuous and bounded.
Any other interesting bounded continuous periodic functions that have interesting properties that you can think of?
The question stems from finding curves similar to the Topologist Sine Curve, that is the image is connected but not path connected. Essential singular points (found in bounded continuous periodic functions) lend themselves well to be counterexamples.
I'm working on an online multiplayer strategy game. I need to have a fully deterministic simulation so that I can minimize communication by only sending player actions across the network, not entire game states.
One thing that would really be helpful is if there was some way to change the default hashing algorithm in rust to be deterministic. I could use HashMap::with_hasher(..) to choose a different hasher. One problem is I'd have to remember it everywhere. Another problem is that a dependency somewhere might still use HashMap::new() and sneak in a source of nondeterminism that I might miss. I don't actually need a cryptographic hash function at all. Would it be possible to somehow replace std::collections::HashMap with a deterministic fork? Or is there an easier way?
Is there anyone here who has experience with trying to make a non-trivial Rust-program deterministic? Any hints or experience to share?
When looking at two simple and well known algorithms Lehmer/Park-Miller and FNV, I was curious what differentiates them into their separate purposes?
A hash function takes an input to produce a deterministic output, which a PRNG like linked seems it would do too if you give it a seed?
I haven't personally done much with PRNGs (beyond using them at a higher level). Last time I recall was almost a decade ago for a game to appear random in generated content, but in a deterministic way that the seed could be shared to replay the "randomness" instead of tracking all that state. I think it may have been the Lehmer one I've linked too.
So are the functions of PRNG and hashing related/complimentary? Would a difference be in the intended behaviour/output? I think both ideally aim for being uniformly random while also being deterministic with their outputs?
So I've been reading the official Chia WiKi (Amazing stuff!) And am a bit confused with some of the terminology used.
The first phase generates all of your proofs of space by creating seven tables of cryptographic hashes and saving them to your temporary directory
By Cryptographic hashes, do they mean cryptographic hash function (CHF) ?
So we are creating a database with 7 individual CHFs?
Thanks a lot.
I got this double has function from this video https://www.youtube.com/watch?v=QWVBu_GlUgI&t=877s&ab_channel=DerekBanas on youtube but it seems that it won't work properly any fixes to this?
public void DoubleHashing(String[] stringArray,String[] theArray){
for (int i=0;i<stringArray.length;i++){
String Element=stringArray[i];
int arrayIndex=Integer.parseInt(Element)%(stringArray.length);
int doublehashfunc=7-(Integer.parseInt(Element))%7;/
System.out.println("Modulus index= "+ arrayIndex+ "for value "+ Element);
while(theArray[arrayIndex]!="-1"){
arrayIndex =arrayIndex+doublehashfunc;
arrayIndex=arrayIndex%stringArray.length;
}
theArray[arrayIndex]=Element;//inputting into hashtable
}
}
I tried inputting the value {10,20,30,40,50,8,60,15,30,45,11,13,17,19,100},Β like this (PS: my class name is Hashing). I also declare an array of -1 with the size of 15 and name it ArrayforHash
public static void main(String[] args) {
Hashing HashData=new Hashing(15);
String[] number={"10","20","30","40","50","8","60","15","30","45","11","13","17","19","100"};
HashData.DoubleHashing(number,HashData.ArrayforHash);
HashData.displayarray();
}
Im confused as the code keeps on going and cant seem to find a place, where am i getting things wrong here?
This is one topic of a series of technical information regarding cryptocurrencies, especially Safemoon. You can find the main post with an index over here:
Crypto and Safemoon - technical FAQ and basics
Cryptographic hash-functions
A hash-function generates a fixed-length fingerprint for inputs of unspecified size.
Hash-functions (non-cryptographic) can be used to create an error detecting number (Message digest MD, Message authentication Code MAC; couldnt find the right expression...), e.g. the ISBN-number of a book contains a number that can be used to check, if the ISBN is valid or you made a typo while typing it in.
Cryptographic has-function fulfil a few special criteria:
- Deterministic
The same input will always result in the same output. (wouldnt be much of a fingerprint if that criteria isnt met...)
- Irreversibility
It is impossible to backtrack the output to the input. Eg if you hash a password, you would not want anyone to be able to determine the password from the hash value.
- Collision resistant
Different inputs will most certainly result in non-identical outputs. If two different inputs result in an identical output, we will have a problem. This one is all about statistics and probability again. We have literally an unlimited amound of inputs versus a fixed output. There will be collisions - but not if we merly hash for a few thousand years with a supercomputer.
- Avalance effect
Small change of the input results in drastic change of the output.
Cryptographic hashfunctions are used in many scenarios, one is to store passwords: they are hashed before they are stored, so even if the database gets compromitted, no plain passwords will be leaked. If a user enters a password on a websites form, it (hopefully, watch for https and the lock in your browsers address-thing) is encrypted an then send to the server. Then it will be hashed as well and the resulting hash is compared the the stored hash. If they are equal, the user entered the correct password.
Now it is getting a little bit more complicated. We can use hash-functions to PROVE that a message was not altered when we receive it. (Cool, right, here the blockchain slowly comes into reach)
Imagine the following process:
Alice writes a message to Bob - asymmetric encryption only
Alice writes the message
Alice encrypts the message with Bobs public key
Al
... keep reading on reddit β‘On a whim I implemented SHA-3 in our language last month. I wasn't intending to do anything with it except say I'd made it, but it's actually turned out to be pretty valuable as a way to detect compiler bugs. Statistically it's incredibly unlikely that a compiler bug that alters the hashing algorithm will change it in such a way that you'll still get the same output hash for a given input. Shove random values into your hashing algorithm and compare the output to a verified implementation, and you basically won't need to worry about false positives.
The caveat here is that you shouldn't take this as proof that your compiler can compile anything correctly. It's strong inductive evidence that it can compile your hashing algorithm correctly, but that's it. This is a tool for alerting you to problems, not formal verification.
I don't get it. I don't understand something at the intersection of cryptography (hash functions) and compression. I'm hoping you guys can shed some light on this...
Say you have a hash function. You give it a hash as an input. Of course, you'll get a random hash as an output. Imagine you then put that output in as an input to the same function. You'll get a new random hash as an output.
You can continue doing this forever, except not really forever because the space is technically limited. Eventually, you'll loop, but that's beside the point. The point is, you can, most likely, do this for a very, very, very long time without ever seeing a hash you've already seen. (I created a post exploring these implications here: https://medium.com/coinmonks/what-does-a-hash-function-look-like-3f1bddd22d1 if you want to really see where I'm coming from).
Let's say I have a really small hash function that spits out 2 letters as a hash. Let's say I send in, "he" and it returns (at random) "ll" and I send in "ll" and it returns at random "ow" and I send in "ow" and it spits out, "or" and I send in "or" and it spits out "ld".
See where I'm going with this? You have a hash function that has within it a "path" of hashes that spell out "helloworld". Now hash functions are random. But if you randomly found the hash function that would produce this string of hashes you'd have a compression function wouldn't you? The function + the beginning key, "he" is a compressed representation of 'helloworld' (of course in this example it's actuality not, because helloworld is really short, but imagine the data was a novel or the contents of a huge database instead).
Now, a hash function itself, the code that describes it, is quite small. And the beginning key is quite small even for regular hash functions. So it seems you can compress data this way. What you need is the ability to find the correct parameters of a hash function space such that you find the correct hash function that is ordered in the way your data is ordered. (Really, you only need a tiny amount of the space to be ordered just like your data, an island of order amongst the sea of chaos). Then, as long as you're willing to unfold the data in that specific order, you could potentially have a massively compressed dataset.
When I say it's compressed I mean, practically speaking, you have a representation of the data that you can send over t
... keep reading on reddit β‘Hash function is an operation that creates a unique value of fixed length with mathematical functions of various lengths of data. It is a one-way function, and although there is no relationship between the processed text and the summary value, the original data cannot be obtained from the obtained summary value. In the hash process, the same value is produced for the same data, but when there is a slight change, the value created by the hash function also changes. Digest functions are widely used in areas such as verifying the integrity of data, storing passwords, digital signature, message verification code. Another area of ββuse is Blockchain applications, which are popular today.
Abstract functions MD family, HAVAL, SHA family, WHIRLPOOL, RIPEMD etc. algorithms. There is also the possibility that different inputs create exactly the same outputs in summary functions. In this case, it is called collision. Conflict is not desirable for hash functions and damages the reliability of the function. The advantages of this approach are that hash functions ensure data integrity, produce fixed and small size outputs, and produce fast output for each input length. For the ideal cryptographic hash function to be considered safe, it must have three properties.
- Conflict Resistance: No two different inputs produce the same summary as output.
- Inverse image resistance: The original data cannot be found from the hash function generated by the hash function.
- Secondary reverse image resistance: It should be very difficult for two separate messages to have the same hash.
MD series message digest algorithms were developed by Ron Rivest. It is one of the most used hashing algorithms in recent years. All of these algorithms give 128-bit output.
The SHA-1 series was developed by the NSA (National Security Agency) and became the standard in the USA with the support of NIST. It creates 160 bit output.
The RIPE-MD-160 (RACE Integrity Primitives Evaluation Message Digest) algorithm is an algorithm used in the European Union, generating 160 bits of output.
MAC (Message Authentication Codes) needs a key to create and verify the difference from other functions. Keyed hash message verification codes (HMAC) are a key-based, one-way hash method that provides both data integrity and verification of the data source. Although HMACs are used in data exchange, they can also be used to check whether the files belonging to any person have been changed or not.
https://previe
... keep reading on reddit β‘I'm a computer science student currently working on my graduation project. The project is about exploiting collision in hash functions. The basic idea is I'm going to classify hash functions into categories and then pick one candidate per each category and apply a hash collision attack (or several) to see what are the results and conclude/generalize . I only managed to find 4 categories:
Those are the constructions I could find. I don't know if there exits any other constructions I'm not aware of. If so, please link them all here and maybe give a short explanation about them if possible. Furthermore, I'm really struggling with finding collision attacks. I read about 20ish papers and only a handful are proper attacks that explain everything and could indeed find a collision. Of course I'm talking about already broken hash functions even though my project primary goal is to see why some attacks would work on a certain construction/hash function but fail on the other. I'll update the post and link the attacks I could find when I get home. I just want to say I'm by no means an expert in cryptography. Heck, I only know a thing or two about this field so hopefully some of you could guide me.
Thanks in advance!
Edit: Those are the attacks I found:
For MD5:
For SHA-1:
These are the attacks I could find. There are other major papers such as Wang et al. on MD5 but it doesn't describe the attack so I left it out.
Why is it generally accepted that the zeta function has zeros at -2n on the real number line? Obviously, it seems entirely unintuitive that the series converges there, let alone at zero, however, I understand it has something to do with recognizing a pattern within and then applying it to those coordinates. What exactly is that?
I am unable to process a hash function.
So I am doing this numerical which is Schnorr Signature scheme. I have got the values of q = 83, p = 997, d = 23, e0 which is the first primitive root is taken as 7. Using e0 I have got e1, e2 pair as ( 9,521 ).
The value of r is 11 and the Message is 400, The value of h(...)= 100. I do not understand how to process this "h(...) = 100". The formula for S1 is M|e1^r mod p. I calculated e1^r mod p to get 67.
The term M|e1^r mod p becomes 40067. How do I use this in the Hash function?? For verification.
Using S1, I need to find S2, and then do the verification right.
The most similar application I've seen is DNA/q-gram searching. Where the DNA alphabet is 4 characters and the q-grams are anywhere up to 31 characters long.
I found this paper which implements a solution that uses circular bit shifting and a random 64-bit key for letters.
It seems to do a pretty decent job minimizing collisions while also allowing rolling hashes.
I implemented my own version and did some testing. For a q-gram of size q and alphabet size l, I'm getting l^q possible permutations of qgrams, and (l^q)/l unique hashes per q gram. On average this comes out to l possible matches (size of alphabet) per hash. This helps a lot when q is say 15-30. I'm aiming for something that is highly performant in the range of 6 <= q <= 10, with an emphasis on the 7-9 range.
Any ideas? π
Hi everyone Iβve recently started exploring hashing and hash functions. I believe that teaching a particular topic to people is the best way to learn and master a subject which is why Iβve made a video about the introduction to hashing and hash functions.
Would really really appreciate if you could go through the video and et me know what you make of it. Feedback Appreciated
https://youtu.be/JP9NQh58rEI
For instance, let's say we have a function create a flat_hash_map and return it.
```
flat_hash_map<string, string> GetMapping() {
flat_hash_map<string, string> mapping = {
"K1", "V1",
"K2", "V2",
};
return mapping;
}
```
(Note: Please ignore RVO for the purpose of this question)
When this function is called, we'll first create the map and return a copy of the map which is suboptimal. I considered this alternate approach but had some questions.
```
unique_ptr<flat_hash_map<string, string>> GetMapping() {
...
return make_unique<flat_hash_map<string, string>>(mapping);
}
```
Does this approach work?
Is `mapping` actually stored "properly" in the smart pointer or is this being done incorrectly?
Are we copying the data while creating the smart pointer?
What is the proper way to use a smart pointer in this scenario?
Is there another/better option than a smart pointer or returning by value?
Edit: after giving it some more thought, this would probably be a problem when putting the data through the hash function again, right? Because the order of input needs to be exactly the same, so it is not deterministic. Is that correct?
https://youtu.be/JP9NQh58rEI
Is there a hash function generator that takes parameters and can produce various hash functions?
I've never heard of something like this, but why not? It would be like tweaking the way MD5 works or something, right? It would be the same space of hashes but those hashes would be arranged in a different order throughout the space (because the hash function is built on different parameters than the regular MD5).
Does this kind of thing exist?
I'm not a cryptographer, can anyone point me in the right direction to learn more about this idea / pattern? thanks!
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.