. Net System.Security.Cryptography namespace itself is to provide cryptographic services, hash functions, symmetric and asymmetric cryptographic algorithms and other functions. In fact, the demand has been met in most cases, and. NET implementation of the current international more authoritative, standardized algorithms, so it is safe and reliable. But there are some occasions when you need to implement some secure hashing algorithms yourself. It is not just learning, it can also be tested and related research. And the formal one to be introduced today includes almost all of the hash function algorithms currently implemented. NET open source components, you can actually use, view or modify and so on. Meet more different people, different levels of demand. Then take a look at the basics and the introduction of the components.
NET Open Source directory: "Directory" of this blog other. NET open source project articles Directory
The original address of this article:. NET Platform Open Source project quick glance (one) Kwcombinatorics arrangement combination use case (1)1. Hashing Algorithm Introduction
Hash functions, which are commonly referred to as hash functions, are commonly used as Md5,sha. A hash function is equivalent to a "fingerprint", which is irreversible, can have no key, or can have a key. Given an arbitrary-length message m, a fixed-length hash value m can be generated.
The feature that the hash function must satisfy is that it is difficult to calculate the hash value of M, whereas it is difficult to find 2 messages with the same hash value. Generally used to prevent tampering, such as many large software downloads, the site will publish the hash value of the file, after downloading can be calculated according to the tool hash value comparison, to see whether the file is correct or modified.
Hash is not equal to encryption, many times developers are in the user table to hash the password to save, in fact, is not called encryption, just equivalent to the "signature fingerprint" of the password to save, and for illegal attackers, do not know the real "password" situation, it is extremely difficult to get the same fingerprint password.
For example, when Microsoft official download file, we will provide a hash verification code, the purpose is to let you download, check, to prevent the file from being modified. Make sure that the files you download are valid and official versions.2.HashLib Function Introduction
Here you can find a large number of hashing algorithms for the C # implementation. Includes SHA3 and candidate algorithms. You can use it to hash validation of files, data streams, and commonly used data types. The supported algorithms are:
1. Non-encrypted 32-bit hashing algorithm: AP, BKDR, Bernstein, Bernstein1, DEK, DJB, ELF, FNV, fnv1a, JS, Jenkins3, MURMUR2, Murmur3, Oneattime, PJW, RS, rotating, sdbm, Shiftandxor, SuperFast
2. Non-encrypted 64-bit hashing algorithm: FNV, FNV1A, MURMUR2, Siphash
3. Non-encrypted 128-bit hashing algorithm: MURMUR3
4. Checksum algorithm: Adler32, CRC32, CRC64
5. All algorithms are based on the System.Security.Cryptography namespace: MD5, RIPEMD160, SHA1, SHA256, SHA384, SHA512
6. Cryptographic algorithms: GOST, Grindahl, HAS160, Haval, MD2, MD4, MD5, Panama, Radiogatun, Ripemd, RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD32 0, SHA0, SHA1, SHA224, SHA256, SHA384, SHA512, Snefru, Tiger, Tiger2, Whirlpool
7.SHA3 and SHA2 candidate algorithms: Blake, Bluemidnightwish, CubeHash, Echo, Fugue, Groestl, Hamsi, JH, Keccak, Luffa, Shabal, SHAvite3, SIMD, Skein
Official website: http://hashlib.codeplex.com/
Simple to use, refer to the official example.
. NET Platform Open Source project Quick glance (12) hash algorithm Collection Class library Hashlib