Skip to content

Commit

Permalink
Update cipher plugin descriptions ##crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainpelissier authored Nov 10, 2024
1 parent edbc14b commit 5358257
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 17 deletions.
7 changes: 7 additions & 0 deletions libr/crypto/hash/sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
} while (0)

R_API ut64 r_hash_sip(const ut8 *in, ut64 inlen) {
/* SipHash-2-4 using the key:
0xb5d4c9eb79104a796fec8b1b428781d4 (big-endian)
*/
const ut8 *end;
// v0 = k0 ^ 0x736f6d6570736575
ut64 v0 = 0x0a257d1c9bbab1c0ULL;
// v1 = k1 ^ 0x646f72616e646f6d
ut64 v1 = 0xb0eef52375ef8302ULL;
// v2 = k0 ^ 0x6c7967656e657261
ut64 v2 = 0x1533771c85aca6d4ULL;
// v3 = k1 ^ 0x7465646279746573
ut64 v3 = 0xa0e4e32062ff891cULL;
for (end = in + (inlen & ~7ULL); in != end; in += 8) {
ut64 m = ((ut64)in[7] << 56)
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ RCryptoPlugin r_crypto_plugin_aes = {
.type = R_CRYPTO_TYPE_ENCRYPT,
.meta = {
.name = "aes-ecb",
.desc = "Block Cipher Mode for Rijndael Encryption",
.desc = "Rijndael block cipher with Electronic Code Book mode",
.author = "pancake",
.license = "MIT",
},
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_aes_cbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ RCryptoPlugin r_crypto_plugin_aes_cbc = {
.type = R_CRYPTO_TYPE_ENCRYPT,
.meta = {
.name = "aes-cbc",
.desc = "Cipher Block Chaining Mode for Rijndael Encryption",
.desc = "Rijndael block cipher with Cipher Block Chaining mode",
.author = "pancake",
.license = "LGPL-3.0-only",
},
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_aes_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ RCryptoPlugin r_crypto_plugin_aes_wrap = {
.type = R_CRYPTO_TYPE_ENCRYPT,
.meta = {
.name = "aes-wrap",
.desc = "Advanced Encryption Standard Key Wrap Algorithm (RFC 3394)",
.desc = "Rijndael block cipher with Key Wrap Algorithm (RFC 3394)",
.author = "Sylvain Pelissier",
.license = "LGPL-3.0-only",
},
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_des.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ RCryptoPlugin r_crypto_plugin_des = {
.meta = {
.name = "des-ecb",
.author = "deroad",
.desc = "Simplest and weakest Electronic Code Book for DES",
.desc = "DES with with Electronic Code Book mode",
.license = "LGPL-3.0-only",
},
.set_key = des_set_key,
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_serpent.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ RCryptoPlugin r_crypto_plugin_serpent = {
.type = R_CRYPTO_TYPE_ENCRYPT,
.meta = {
.name = "serpent-ecb",
.desc = "Bouncy Castle Cryptography",
.desc = "Serpent block cipher with Electronic Code Book mode",
.license = "LGPL-3.0-only",
.author = "pancake",
},
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static bool update(RCryptoJob *cj, const ut8 *buf, int len) {
RCryptoPlugin r_crypto_plugin_sip = {
.meta = {
.name = "sip",
.desc = "SipHash",
.desc = "SipHash-2-4",
.author = "pancake",
.license = "MIT",
},
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_sm4.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RCryptoPlugin r_crypto_plugin_sm4 = {
.type = R_CRYPTO_TYPE_ENCRYPT,
.meta = {
.name = "sm4-ecb",
.desc = "ShāngMì4 block cipher",
.desc = "ShāngMì4 block cipher with Electronic Code Book mode",
.author = "Sylvain Pelissier",
.license = "LGPL-3.0-only",
},
Expand Down
2 changes: 1 addition & 1 deletion libr/crypto/p/crypto_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RCryptoPlugin r_crypto_plugin_xor = {
.type = R_CRYPTO_TYPE_ENCRYPT,
.meta = {
.name = "xor",
.desc = "Byte level Exclusive Or Encryption",
.desc = "Byte level Exclusive Or",
.author = "pancake",
.license = "MIT",
},
Expand Down
2 changes: 1 addition & 1 deletion test/db/cmd/hash
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ CMDS=<<EOF
phj
EOF
EXPECT=<<EOF
[{"name":"aes-ecb","type":"encryption","author":"pancake","description":"Block Cipher Mode for Rijndael Encryption","license":"MIT"},{"name":"aes-cbc","type":"encryption","author":"pancake","description":"Cipher Block Chaining Mode for Rijndael Encryption","license":"LGPL-3.0-only"},{"name":"aes-wrap","type":"encryption","author":"Sylvain Pelissier","description":"Advanced Encryption Standard Key Wrap Algorithm (RFC 3394)","license":"LGPL-3.0-only"},{"name":"base64","type":"encoder","author":"rakholiyajenish.07","description":"Binary to text encoding scheme using 64 ascii characters","license":"LGPL-3.0-only"},{"name":"base91","type":"encoder","author":"rakholiyajenish.07","description":"Binary to text encoding scheme using 91 ascii characters","license":"MIT"},{"name":"bech32","type":"encoder","author":"W0nda","license":"BSD-3-Clause"},{"name":"blowfish","type":"encryption","author":"pancake","description":"Bruce Schneier's symetric-key block cipher","license":"LGPL-3.0-only"},{"name":"cps2","type":"encryption","author":"pof,esanfelix","description":"Capcom Play System 2","license":"LGPL-3.0-only"},{"name":"des-ecb","type":"encryption","author":"deroad","description":"Simplest and weakest Electronic Code Book for DES","license":"LGPL-3.0-only"},{"name":"ed25519","type":"signature","author":"Sylvain Pelissier","description":"Elliptic curve pubkey cryptographic algorithm used for signing and verification","license":"Zlib"},{"name":"entropy","type":"hash","author":"pancake","description":"Collected randomness by a syustem","license":"MIT"},{"name":"punycode","type":"encoder","author":"pancake","description":"Unicoded represented in plain ascii","license":"LGPL-3.0-only"},{"name":"rc2","type":"encryption","author":"pancake","description":"Ron Rivest's Code symmetric key encryption also known as ARC2","license":"LGPL-3.0-only"},{"name":"rc4","type":"encryption","author":"pancake","description":"Rivest Cipher 4","license":"LGPL-3.0-only"},{"name":"rc6","type":"encryption","author":"pancake","description":"Rivest's Cipher 6","license":"LGPL-3.0-only"},{"name":"rol","type":"encoder","author":"pancake","description":"Rotate Left N bits","license":"LGPL-3.0-only"},{"name":"ror","type":"encoder","author":"pancake","description":"Rotate Right N bits","license":"LGPL-3.0-only"},{"name":"rot","type":"encoder","author":"pancake","description":"Rotate Encryption","license":"MIT"},{"name":"serpent-ecb","type":"encryption","author":"pancake","description":"Bouncy Castle Cryptography","license":"LGPL-3.0-only"},{"name":"sip","type":"hash","author":"pancake","description":"SipHash","license":"MIT"},{"name":"sm4-ecb","type":"encryption","author":"Sylvain Pelissier","description":"ShāngMì4 block cipher","license":"LGPL-3.0-only"},{"name":"strhash","type":"hash","author":"pancake","description":"String hash using a modified DJB2 xor","license":"MIT"},{"name":"xor","type":"encryption","author":"pancake","description":"Byte level Exclusive Or Encryption","license":"MIT"},{"type":"hash","name":"md5"},{"type":"hash","name":"sha1"},{"type":"hash","name":"sha256"},{"type":"hash","name":"sha384"},{"type":"hash","name":"sha512"},{"type":"hash","name":"md4"},{"type":"hash","name":"xor"},{"type":"hash","name":"xorpair"},{"type":"hash","name":"parity"},{"type":"hash","name":"entropy"},{"type":"hash","name":"hamdist"},{"type":"hash","name":"pcprint"},{"type":"hash","name":"mod255"},{"type":"hash","name":"xxhash"},{"type":"hash","name":"adler32"},{"type":"hash","name":"luhn"},{"type":"hash","name":"ssdeep"},{"type":"hash","name":"crc8smbus"},{"type":"hash","name":"crc15can"},{"type":"hash","name":"crc16"},{"type":"hash","name":"crc16hdlc"},{"type":"hash","name":"crc16usb"},{"type":"hash","name":"crc16citt"},{"type":"hash","name":"crc24"},{"type":"hash","name":"crc32"},{"type":"hash","name":"crc32c"},{"type":"hash","name":"crc32ecma267"},{"type":"hash","name":"crc32bzip2"},{"type":"hash","name":"crc32d"},{"type":"hash","name":"crc32mpeg2"},{"type":"hash","name":"crc32posix"},{"type":"hash","name":"crc32q"},{"type":"hash","name":"crc32jamcrc"},{"type":"hash","name":"crc32xfer"},{"type":"hash","name":"crc64"},{"type":"hash","name":"crc64ecma"},{"type":"hash","name":"crc64we"},{"type":"hash","name":"crc64xz"},{"type":"hash","name":"crc64iso"},{"type":"hash","name":"fletcher8"},{"type":"hash","name":"fletcher16"},{"type":"hash","name":"fletcher32"},{"type":"hash","name":"fletcher64"},{"type":"hash","name":"elf"}]
[{"name":"aes-ecb","type":"encryption","author":"pancake","description":"Rijndael block cipher with Electronic Code Book mode","license":"MIT"},{"name":"aes-cbc","type":"encryption","author":"pancake","description":"Rijndael block cipher with Cipher Block Chaining mode","license":"LGPL-3.0-only"},{"name":"aes-wrap","type":"encryption","author":"Sylvain Pelissier","description":"Rijndael block cipher with Key Wrap Algorithm (RFC 3394)","license":"LGPL-3.0-only"},{"name":"base64","type":"encoder","author":"rakholiyajenish.07","description":"Binary to text encoding scheme using 64 ascii characters","license":"LGPL-3.0-only"},{"name":"base91","type":"encoder","author":"rakholiyajenish.07","description":"Binary to text encoding scheme using 91 ascii characters","license":"MIT"},{"name":"bech32","type":"encoder","author":"W0nda","license":"BSD-3-Clause"},{"name":"blowfish","type":"encryption","author":"pancake","description":"Bruce Schneier's symetric-key block cipher","license":"LGPL-3.0-only"},{"name":"cps2","type":"encryption","author":"pof,esanfelix","description":"Capcom Play System 2","license":"LGPL-3.0-only"},{"name":"des-ecb","type":"encryption","author":"deroad","description":"DES with with Electronic Code Book mode","license":"LGPL-3.0-only"},{"name":"ed25519","type":"signature","author":"Sylvain Pelissier","description":"Elliptic curve pubkey cryptographic algorithm used for signing and verification","license":"Zlib"},{"name":"entropy","type":"hash","author":"pancake","description":"Collected randomness by a syustem","license":"MIT"},{"name":"punycode","type":"encoder","author":"pancake","description":"Unicoded represented in plain ascii","license":"LGPL-3.0-only"},{"name":"rc2","type":"encryption","author":"pancake","description":"Ron Rivest's Code symmetric key encryption also known as ARC2","license":"LGPL-3.0-only"},{"name":"rc4","type":"encryption","author":"pancake","description":"Rivest Cipher 4","license":"LGPL-3.0-only"},{"name":"rc6","type":"encryption","author":"pancake","description":"Rivest's Cipher 6","license":"LGPL-3.0-only"},{"name":"rol","type":"encoder","author":"pancake","description":"Rotate Left N bits","license":"LGPL-3.0-only"},{"name":"ror","type":"encoder","author":"pancake","description":"Rotate Right N bits","license":"LGPL-3.0-only"},{"name":"rot","type":"encoder","author":"pancake","description":"Rotate Encryption","license":"MIT"},{"name":"serpent-ecb","type":"encryption","author":"pancake","description":"Serpent block cipher with Electronic Code Book mode","license":"LGPL-3.0-only"},{"name":"sip","type":"hash","author":"pancake","description":"SipHash-2-4","license":"MIT"},{"name":"sm4-ecb","type":"encryption","author":"Sylvain Pelissier","description":"ShāngMì4 block cipher with Electronic Code Book mode","license":"LGPL-3.0-only"},{"name":"strhash","type":"hash","author":"pancake","description":"String hash using a modified DJB2 xor","license":"MIT"},{"name":"xor","type":"encryption","author":"pancake","description":"Byte level Exclusive Or","license":"MIT"},{"type":"hash","name":"md5"},{"type":"hash","name":"sha1"},{"type":"hash","name":"sha256"},{"type":"hash","name":"sha384"},{"type":"hash","name":"sha512"},{"type":"hash","name":"md4"},{"type":"hash","name":"xor"},{"type":"hash","name":"xorpair"},{"type":"hash","name":"parity"},{"type":"hash","name":"entropy"},{"type":"hash","name":"hamdist"},{"type":"hash","name":"pcprint"},{"type":"hash","name":"mod255"},{"type":"hash","name":"xxhash"},{"type":"hash","name":"adler32"},{"type":"hash","name":"luhn"},{"type":"hash","name":"ssdeep"},{"type":"hash","name":"crc8smbus"},{"type":"hash","name":"crc15can"},{"type":"hash","name":"crc16"},{"type":"hash","name":"crc16hdlc"},{"type":"hash","name":"crc16usb"},{"type":"hash","name":"crc16citt"},{"type":"hash","name":"crc24"},{"type":"hash","name":"crc32"},{"type":"hash","name":"crc32c"},{"type":"hash","name":"crc32ecma267"},{"type":"hash","name":"crc32bzip2"},{"type":"hash","name":"crc32d"},{"type":"hash","name":"crc32mpeg2"},{"type":"hash","name":"crc32posix"},{"type":"hash","name":"crc32q"},{"type":"hash","name":"crc32jamcrc"},{"type":"hash","name":"crc32xfer"},{"type":"hash","name":"crc64"},{"type":"hash","name":"crc64ecma"},{"type":"hash","name":"crc64we"},{"type":"hash","name":"crc64xz"},{"type":"hash","name":"crc64iso"},{"type":"hash","name":"fletcher8"},{"type":"hash","name":"fletcher16"},{"type":"hash","name":"fletcher32"},{"type":"hash","name":"fletcher64"},{"type":"hash","name":"elf"}]
EOF
RUN
16 changes: 8 additions & 8 deletions test/db/tools/rahash2
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ NAME=rahash2 -L
FILE=-
CMDS=!rahash2 -L
EXPECT=<<EOF
c aes-ecb Block Cipher Mode for Rijndael Encryption
c aes-cbc Cipher Block Chaining Mode for Rijndael Encryption
c aes-wrap Advanced Encryption Standard Key Wrap Algorithm (RFC 3394)
c aes-ecb Rijndael block cipher with Electronic Code Book mode
c aes-cbc Rijndael block cipher with Cipher Block Chaining mode
c aes-wrap Rijndael block cipher with Key Wrap Algorithm (RFC 3394)
e base64 Binary to text encoding scheme using 64 ascii characters
e base91 Binary to text encoding scheme using 91 ascii characters
e bech32
c blowfish Bruce Schneier's symetric-key block cipher
c cps2 Capcom Play System 2
c des-ecb Simplest and weakest Electronic Code Book for DES
c des-ecb DES with with Electronic Code Book mode
s ed25519 Elliptic curve pubkey cryptographic algorithm used for signing and verification
h entropy Collected randomness by a syustem
e punycode Unicoded represented in plain ascii
Expand All @@ -180,11 +180,11 @@ c rc6 Rivest's Cipher 6
e rol Rotate Left N bits
e ror Rotate Right N bits
e rot Rotate Encryption
c serpent-ecb Bouncy Castle Cryptography
h sip SipHash
c sm4-ecb ShāngMì4 block cipher
c serpent-ecb Serpent block cipher with Electronic Code Book mode
h sip SipHash-2-4
c sm4-ecb ShāngMì4 block cipher with Electronic Code Book mode
h strhash String hash using a modified DJB2 xor
c xor Byte level Exclusive Or Encryption
c xor Byte level Exclusive Or
h md5
h sha1
h sha256
Expand Down

0 comments on commit 5358257

Please sign in to comment.