Tag Info

Ethereum uses KECCAK-256. It should be noted that it does not follow
the FIPS-202 based standard (a.k.a SHA-3), which was finalized in August 2015.
According to this, NIST changed the padding to SHA3-256(M) = KECCAK [512] (M || 01, 256).
This was different from the padding proposed by the Keccak team in The Keccak SHA-3 submission version 3 (final, winning ...

Jehan's answer is great, but we need to explain one more thing: Why does sha3(1) in solidity produce b10e2d...fa0cf6?
This is because solidity's sha3 function hashes its inputs based on the argument types. Thus the value 1 will generate a different hash if it is stored as bytes8, bytes16, bytes32, etc. Since sha3(1) is being passed 1 as a number literal, it ...

Ethereum uses Keccak-256, instead of the SHA-3 FIPS 202 standard. In the sha3 libraries you are using, try looking for the option to specify using Keccak-256.
For Python see Getting Method ID "Keccak hash" in Python
For Javascript, this library js-sha3 would involve using the keccak_256 function instead of sha3_256.
keccak_256('');
// ...

To make it clearer that Ethereum uses KECCAK-256 instead of the NIST standardized SHA-3 hash function, Solidity 0.4.3 has introduced keccak256. (It is an alias to sha3, meaning that keccak256 produces identical results to sha3, but with the intent to avoid confusion, especially for developers new to Ethereum.) It's recommended that new code use keccak256 ...

Extending on this answer:
Ethereum uses Keccak hashing, which was submitted to the NIST competition for SHA3. It was subsequently selected as a winner in 2012, but the final standard was only released in August 2015.
Ethereum uses Keccak in its form as it was selected in 2012. Too bad some parameters of the algorithm were tweaked for the final ...

topics[0] is the hash of the signature of the event.
Example from Solidity docs:
keccak256("Deposit(address,bytes32,uint256)") is the signature of the event:
event Deposit(
address indexed _from,
bytes32 indexed _id,
uint _value
);

web3.sha3() takes an encoding parameter to specify that you are passing in a hex address:
address_string = '0x5b2063246f2191f18f2675cedb8b28102e957458';
web3.sha3(address_string, {encoding: 'hex'});
As a general side-note: you have to pay gas costs to do any custom work in Solidity so, when possible, you are best off working on the javascript side.

The arguments are expressed as bytes, left-padded with zeroes to the maximum length of the data type you've passed in, and concatenated without any kind of delimiter.
In Python, given two hex-encoded bytes32s prepended with a 0x called first and second, it looks something like:
# keccak, change before upgrading pysha >= 3.10
from sha3 import sha3_256
...

from an answer to What are the key differences between the draft SHA-3 standard and the Keccak submission?:
No they did not, the internals and security levels have not been
changed from the draft Keccak submission, only the padding rule has
changed.
The padding change is the only difference, this allows
future tree hashing modes as well as the ...

I believe this is just a bit mask.
The code loads the call data, shifts it to the right, and then does a bitwise AND with 0xFFFFFFFF to get the (now) bottom four bytes (the function selector).
Then it compares the four bytes extracted with the known function selector. It doesn't matter that the function signature you're looking for happens to be 0xFFFFFFFF....

You need to install the latest pyethereum; I just uploaded it as pyethereum 1.3.7, or from the state_revamp branch. That should also automatically install the latest pyrlp, which has one compatibility fix; if it doesn't then you can install it yourself from http://github.com/ethereum/pyrlp.
If you don't do this, then there are going to be a few bugs that ...

The function signatures need to be unique only within a contract. The Solidity compiler will detect and prevent collisions if they are not unique in this case. If you have fewer than 2^16 functions in your contract, collisions are unlikely to happen by chance.
There was a Reddit thread about this recently, but it seems a bit contrived to me and not a ...

In your NodeJS you have to fix the input you are passing to its keccak function. The fix might simply be: keccak_256(firstName+lastName+ studentId); but you have to check your NodeJS library as well as the types you're passing in.
Solidity docs:
keccak256(...) returns (bytes32): compute the Ethereum-SHA-3
(Keccak-256) hash of the (tightly packed) ...

You can use our Firefly Hardware Wallet (https://firefly.city) for the ATmega328 to do:
secp256k1 signing
RLP decoding transactions
keccak256
generating checksum addresses (or raw addresses)
Signing requires in the neighbourhood of around 700 bytes of free memory, I believe, but everything else requires a fairly slim memory footprint.
If you require an ...

I came across this paper that looks at using Keccak-256 (the original one that Ethereum uses, not SHA3) as a PRNG. It subjects the output of the hash to a large number of tests of randomness and it passes them all.
Conclusion:
The experimental results show the KECCAK hash function has excellent
pseudo randomness, and its security shows that it can be ...

A hash function is different to a proof-of-work algorithm. Much of the effort in following a proof-of-work algorithm involves making hashes, but they're distinct things.
Ethash is the proof-of-work algorithm. Keccak-256 is the most commonly-used hash function. Keccak-256 is used internally in places like when making hashes for block headers, but the place ...

You can use web3.utils.soliditySha3()
Alternatively you can try this way:
web3.sha3(web3.toHex(string1) + address1, {encoding:"hex"});
Note that address1 should not be prefixed with 0x.
Example:
> web3.sha3(web3.toHex("test1") + "0AbdAce70D3790235af448C88547603b945604ea", {encoding:"hex"});
"...

SHA3 is just a name and the underlying cryptographic algorithms are elected by an international commitee.
There is no reason why Ethereum should change such a fundamental thing like the basic hash function. This puts the network consensus in danger and would mean a huge effort in upgrading all software and broadcasting the information to all members of the ...

It seems like you treated "315f6b6f74000000000000000000000000000000000000000000000000000000" like a string instead of the hexadecimal byte sequence it actually is.
Via web3 0.2.x:
web3.sha3('315f6b6f74000000000000000000000000000000000000000000000000000000')
> "0x90a0076f07f9884805bdc4d668c55756ff42238a0ad7b824b8a267783e822544"
web3.sha3('...

Like any hash, it has an infinite input space. This enables one to "make a hash" of a super large file. The hash should entirely change if a single bit of data in the source is different - unlike say a CRC32, or a checksum. It means your password could be a million chars long maybe. It's stored on disk as a hash, much smaller in size.
Regarding Keccak, it ...

Saw the following from a recent paper published on February 19 2016.
We have uncovered a worrying lack of defense-in-depth in Bitcoin. In
most cases, the failure of a single property in one cryptographic
primitive is as bad as multiple failures in several primitives at
once. For future versions of Bitcoin, we recommend including various
...

For browser-solidity, keccak256 is fixed in version 0.4.4 and later.
keccak256 is recommended to use, it's identical to sha3, and is less confusing because Ethereum does not use the final SHA-3 standard, but the original winning algorithm named Keccak. More contracts using keccak256 will prevent confusion such as
Why aren't Solidity sha3 hashes not ...

the keccak256() is an alias for the sha3 function to avoid any confusion with the sha-3 standard (The opcode is still called SHA3.) this alias was adopted this month so the old compiler don't recognize it.
so use sha3 instead.
The available hashing functions are sha3, sha256, ripemd160:
pragma solidity ^0.4.0;
contract C {
function hashingsha3 (...