W.Ehrhardt: Crypto

Cryptographic algorithms

  • In most cases encryption should be used together with authentication and decryption with verification.
    Most of the block ciphers have the EAX mode, and the HMAC
    construction can be used with both cipher types;
    see also Poly1305.
  • The secret keys should be produced by

    key derivation functions
    from pass phrases and (session) salts.

  • See the FCA demo for a basic implementation.

  • Anubis
    (designed by Vincent Rijmen and Paulo Barreto) is a 128-bit block cipher that
    uses keys of length 128 to 320 bits in steps of 32 bits. Anubis was
    a NESSIE submission which was not included in the final portfolio. My Pascal
    source implements the so called tweaked version with a recursive structured
    S-box.

    Archive: anubis_2017-11-29.zip


  • Camellia
    is a Feistel block cipher developed jointly by NTT (Nippon Telegraph and Telephone) and Mitsubishi. It uses 128-bit input/output data
    blocks and 128, 192, or 256 bit keys. Camellia is a recommended block cipher of the
    NESSIE portfolio,
    included in ISO/IEC 18033-3, and also described in
    RFC 3713.
    The Feistel code and the S-Boxes are now 32 bit oriented, the encryption / decryption
    loops are unrolled, and the speed was increased (factors: 2.4 .. 2.9 for 32 bit and 1.2 .. 1.4 for 16 bit compilers).

    Archive: camellia_2017-11-17.zip


  • Serpent
    (designed by Ross Anderson, Eli Biham, and Lars Knudsen) was one of
    the AES finalists; it is a 128-bit block cipher with key sizes of 128, 192, or 256 bits.

    Archive: serpent_2017-11-17.zip


  • The SEED cipher has been developed by KISA
    (Korea Information Security Agency). It uses 128-bit input/output data
    blocks and 128-bit keys. SEED is specified in ISO/IEC 18033-3 and
    in RFC 4269.

    Archive: seed_2017-11-29.zip


  • The 256-bit block cipher SHACAL-2
    is based on the compression function of SHA256. It supports keys sizes from 128 to 512 bits. SHACAL-2 is designed by Helena
    Handschuh and David Naccache and is the only recommended 256-bit block
    cipher of the NESSIE portfolio.

    Archive: shacal2_2017-11-29.zip


  • SkipJack
    is a compact 64-bit block cipher with 80-bit keys. It was
    designed by the NSA as an unbalanced Feistel network with 32 rounds; in
    1998 it was declassified and published by NIST (the specification was
    clarified in 2002).

    Archive: skipjack_2017-11-29.zip


  • XTEA (eXtended TEA) is another compact 64-bit block cipher with
    128-bit keys described by David Wheeler and Roger Needham.

    Archive: xtea_2017-11-29.zip
  • poly_32x32 uses 32 x 32 -> 64 bit multiplication
    and is default for compilers with u/int64 data types (D4+, FPC),
  • poly_16x16 with 16 x 16 -> 32 bit multiplication for all
    other compilers without int64.
  • During development I also
    translated poly_8x8: it is available as a separate file,
    but not actually used (slower for all tested CPUs/compilers).
© 2018 W.Ehrhardt Last update Jan. 01, 2018
Home CRC/Hash Crypto Misc. Info Links Deutsch
A E S
Compiler Cyc/Bl-F MB/s-F Cyc/Bl-C MB/s-C
TP5 6302 4.6 5356 5.4
TP55 6321 4.5 6980 4.1
TP6 1436 20.0 1762 16.3
BP7 1493 19.2 1927 14.9
Delphi2 365 78.6 398 72.1
Delphi3 373 76.9 398 72.1
Delphi4 386 74.3 398 72.1
Delphi5 375 76.5 398 72.1
Delphi6 380 75.5 398 72.1
Delphi7 380 75.5 398 72.1
Delphi9 381 76.3 397 72.3
Delphi10 380 75.0 398 72.1
VPC 426 67.3 425 67.3
FPC 2.2 -O3 416 69.0 417 68.8
FPC 1 GoV2 542 53.0 541 53.1
Package/Compiler CTR CFB OFB ECB CBC OMAC
LibTom117/VC6 13.0 16.3 16.4 12.9 13.9 15.6
LTC117/GCC4.2.1 10.1 14.5 10.6 9.0 9.3 14.2
dcpcrypt2/D6 28.8 32.7 28.6 32.7
DEC5.1/D6 13.9 10.9 10.2 11.8
StrSecII/D6 9.0 11.5 9.1 7.7 9.3
WE/D3 9.0 8.1 8.1 7.7 9.1 9.1
WE/D6 9.0 8.0 8.0 7.7 8.4 9.1
WE/FPC 2.2 -O3 9.9 9.1 9.1 9.0 11.2 9.0
WE/VPC 2.1 10.4 10.2 10.3 9.3 13.9 12.0
WE/BP7 47.1 41.4 41.4 34.3 51.0 45.3
Func/Bit ASM C++ D6 VPC FPC2 BP7
Enc/128 295 385 370 425 546 1490
Dec/128 293 376 382 405 551 1545
Enc/192 352 439 434 532 648 1768
Dec/192 346 443 451 476 653 1723
Enc/256 403 497 498 580 751 1948
Dec/256 407 507 518 549 755 1971
Twofish
Package/Compiler CTR CFB OFB ECB CBC OMAC
LibTom112/VC6 11.9 14.6 14.4 10.3 11.2 14.4
LTC112/GCC4.0.1 13.4 14.9 13.5 12.5 11.7 14.2
dcpcrypt2/D6 21.5 25.4 21.3 25.7
DEC5.1/D6 31.9 28.7 27.7 29.6
StrSecII/D6 13.0 14.7 13.0 10.7 12.1
WE/D3 14.8 14.0 13.9 13.8 16.0 16.3
WE/D6 15.2 14.0 13.9 13.9 15.6 15.0
WE/FPC2 20.4 20.4 20.3 19.5 21.9 20.1
WE/VPC 17.6 17.3 17.6 17.0 22.9 18.4
WE/BP7 72.0 68.5 67.9 61.6 76.0 72.2
Blowfish
Package/Compiler CTR CFB OFB ECB CBC OMAC
LibTom112/VC6 12.0 14.1 13.8 11.3 15.6 16.7
LTC112/GCC4.0.1 13.1 12.8 11.8 9.9 10.5 17.8
dcpcrypt2/D6 21.0 28.5 20.8 30.3
DEC5.1/D6 13.7 12.0 12.1 13.7
StrSecII/D6 14.1 15.1 14.0 10.9 13.5
WE/D3 14.0 12.2 10.8 10.2 12.4 11.5
WE/D6 14.1 12.3 10.8 10.6 12.4 11.4
WE/FPC2 18.2 17.4 18.8 14.5 16.8 16.5
WE/VPC 20.0 21.0 19.2 19.2 26.3 22.6
WE/BP7 64.8 57.1 57.1 40.7 72.8 58.3
Salsa20 / XSalsa20 / ChaCha
Compiler k8 k12 k20 e8 e12 e20 Rem.
ASM P4 F12 2.54 3.62 5.57 (1)
GCC 4.3.2 -O3 5.71 7.36 9.50 5.44 7.03 9.12 (2)
VC6 SP4 /O2 6.65 8.29 11.59 6.37 8.07 11.37 (2)
Delphi 3 3.57 4.93 7.93 6.16 7.53 10.23
Delphi 6 3.57 4.94 7.94 6.25 7.62 10.32
Delphi 10 3.57 4.93 7.94 6.12 7.48 10.21
VPC 2.1.279 4.40 5.77 8.51 6.89 8.25 10.98
FPC 2.2.4 -O3 4.57 5.93 8.66 7.92 9.33 11.92
BP7 Real 4.85 6.19 8.88 5.34 6.68 9.37
Sosemanuk
Compiler   k [s] k [MB/s]   e [s] e [MB/s]
GCC 4.3.2 -O3 7.253 110.3 10.220 78.3
VC6 SP4 /O2 7.520 106.4 10.930 73.2
Delphi 3 3.022 264.7 6.868 116.5
Delphi 6 3.013 265.5 6.897 116.0
Delphi 10 3.634 220.1 7.565 105.7
VPC 2.1.279 4.613 173.4 8.356 95.7
FPC 2.2.4 -O3 6.284 127.3 11.543 69.3
BP7 Real 5.490 145.7 7.679 104.2
Other block ciphers
Poly1305
Home CRC/Hash Crypto Misc. Info Links Deutsch

Before downloading any software from this site please read this
legal notice.
Last changes: CBC, CFB128, CFB8, CTR, ECB, OFBOMAC, CMAC, CCM, EAX, GCM, XTSt_gsp128t_aes_wst_gspeedaestmr.cppASMC++compressed tablest_mkctabcache timing attacksaes_conf.incFCA demo programfcaes256Giorgio Tanifca256Giorgio TaniLast changes: FZCA programNote:Last changes: Last changes: Last changes: t_salwekxexsalsarXSalsa20ChaChaEddyHawkMartokLast changes: t_soseweGCCVC6keLast changes: general Poly1305 algorithmmustmayencfilemayresetresetxorchacha_xkeysetupAESTwofishBlowfishSalsa20/XSalsa20/ChaChaSosemanukother block ciphersAnubisCamelliaSEEDSerpentSHACAL-2SkipJackXTEAaes_2017-11-17.ziphrtimeraes_cmpsrc_2006-07-30.zipLinksPeaZipfca_2017-11-17.zipaes_2017-11-17.ziputil_YYYY-MM-DD.zipcrc_hash_YYYY-MM-DD.zipzlibtf_2017-11-17.ziptf_cmpsrc_2006-06-15.zipbf_2017-11-29.zipbf_cmpsrc_2006-06-15.zipSalsa20eSTREAM Portfoliosalsa_2017-11-29.zipPRNGSosemanukeSTREAM Portfolioarchivesosemanuk_2017-11-29.zipSerpentpoly1305_2017-11-29.zipGithubRFC 7539

Nach oben scrollen