AVR-Crypto-Lib/en: Unterschied zwischen den Versionen

Aus LaborWiki
Wechseln zu: Navigation, Suche
(What should be done)
(Facts)
Zeile 59: Zeile 59:
  
 
==Facts==
 
==Facts==
<!--
+
 
{| {{Prettytable}}
+
===Blockchiffren===
! Name !! Kategorie !! C !! ASM !! Blockgröße !! Ausgabegröße/Keylänge!! Größe im Flash !! Größe des States !! Bemerkungen
 
|-
 
|SHA-256 || Hashfunktion || x || x || 512 Bit || 256 Bit || 1600 Byte (ASM) || 40 Byte || gilt als relativ sicher
 
|-
 
|MD5 || Hashfunktion || x || - || 512 Bit || 128 Bit ||  || 20 Byte || gilt als wenig sicher (Kollisionen gefunden)
 
|-
 
|XTEA || Blockcipher || x || x || 64 Bit || 128 Bit || 504 Byte (ASM) || - || Wikipedia: ''As of 2004, the best attack reported on XTEA is a related-key differential attack on 26 out of 64 rounds of XTEA, requiring 220.5 chosen plaintexts and a time complexity of 2^115.15 (Ko et al, 2004).''
 
|-
 
|CAST5 || Blockcipher || x || - || 128 Bit || 0-128 Bit ||  || 75 Byte || gilt als ziemlich sicher (Standard in GPG), aber fett (8k S-Boxen!)
 
|-
 
|ARCFOUR || Streamcipher || x || x || 8 Bit (Ausgabe) || 8 - 2048 Bit || 122 Byte (ASM) || 258 Byte || ist kompatibel mit RC4(TM)
 
|}
 
-->
 
===Blockciphers===
 
 
{| {{Prettytable}}
 
{| {{Prettytable}}
 
| align="center" style="background:#f0f0f0;"|'''name'''
 
| align="center" style="background:#f0f0f0;"|'''name'''
 
| align="center" style="background:#f0f0f0;"|'''variant'''
 
| align="center" style="background:#f0f0f0;"|'''variant'''
 
| align="center" style="background:#f0f0f0;"|'''language'''
 
| align="center" style="background:#f0f0f0;"|'''language'''
| align="center" style="background:#f0f0f0;"|'''size (flash)'''
+
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
| align="center" style="background:#f0f0f0;"|'''size (context)'''
+
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
| align="center" style="background:#f0f0f0;"|'''size (stack)'''
+
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
| align="center" style="background:#f0f0f0;"|'''keylength'''
+
| align="center" style="background:#f0f0f0;"|'''keysize (bits)'''
| align="center" style="background:#f0f0f0;"|'''blocksize'''
+
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
| align="center" style="background:#f0f0f0;"|'''clocks (init)'''
+
| align="center" style="background:#f0f0f0;"|'''time (initalisation)'''
| align="center" style="background:#f0f0f0;"|'''clocks (encrypt)'''
+
| align="center" style="background:#f0f0f0;"|'''time (encrypt)'''
| align="center" style="background:#f0f0f0;"|'''clocks (decrypt)'''
+
| align="center" style="background:#f0f0f0;"|'''time (decrypt)'''
 
| align="center" style="background:#f0f0f0;"|'''attacks'''
 
| align="center" style="background:#f0f0f0;"|'''attacks'''
 
| align="center" style="background:#f0f0f0;"|'''paper'''
 
| align="center" style="background:#f0f0f0;"|'''paper'''
 
| align="center" style="background:#f0f0f0;"|'''license / patents'''
 
| align="center" style="background:#f0f0f0;"|'''license / patents'''
 
|-
 
|-
| Camellia||C||C||||32||||128||128||||||||||||
+
| Camellia||C||C|| ||32|| ||128||128|| || || || || ||
 +
|-
 +
| Camellia||C+Asm||C+Asm||5803||32|| ||128||128|| || || || || ||
 +
|-
 +
| Cast5||C||C||14108||75|| ||0-128||64||13739||12550||13109|| || ||
 +
|-
 +
| RC5||RC5-32/r/b||C||1524||3+(8*#Runden+1)|| ||1 – 2040||64||79352||7827||7223|| || ||
 
|-
 
|-
| Camellia||C+Asm||C+Asm||5803||||||||||||||||||||
+
| RC6||RC6-32/r/b||C||2656||19+(8*#Runden)|| ||1 – 2040||128||139940||26600||25986|| || ||
 
|-
 
|-
| Cast5||C||C||14108||75||||0-128||64||13739||12550||13109||||||
+
| Noekeon||C||C|| ||0 (16)|| ||128||128|| || || || || ||
 
|-
 
|-
| RC5||RC5-32/r/b||C||1524||3+(8*#rounds+1)||||1 – 2040||64||79352||7827||7223||||||
+
| Noekeon||Asm||Asm||870||0 (16)|| ||128||128||10566||10340||10895|| || ||
 
|-
 
|-
| RC6||RC6-32/r/b||C||2656||19+(8*#rounds)||||1 – 2040||128||139940||26600||25986||||||
+
| DES||C||C||2480||0|| ||56||64|| || || || || ||
 
|-
 
|-
| Noekeon||C||C||||0 (16)||||128||128||||||||||||
+
| TDES||C||C||2480||0|| ||168||64||0||852082||852107|| || ||
 
|-
 
|-
| Noekeon||Asm||Asm||870||||||||||10566||10340||10895||||||
+
| Serpent||Non-bitslice||C|| ||528|| ||1 – 256||128|| || || || || ||
 +
|-
 +
| Serpent||bitslice||C||4498||528|| ||1-256||128||102098||70827||70462|| || ||
 +
|-
 +
| Skipjack||C||C||1244||0|| ||80||64|| || || || || ||
 +
|-
 +
| Present||C||C||1514||256|| ||80||64||30395||105796||151624|| || ||
 +
|-
 +
| SEED||C||C|| ||16|| ||128||128|| || || || || ||
 +
|-
 +
| SEED||C+Asm||C+Asm||4052||16|| ||128||128|| || || || || ||
 +
|-
 +
| XTEA||C||C|| ||0|| ||128||64|| || || || || ||
 +
|-
 +
| XTEA||Asm||Asm||504||0|| ||128||64|| || || || || ||
 +
|-
 +
| Shabea||C||C||2020||0||||0 – infinit||256|| || || || || ||
 +
|}
 +
 
 +
===Stromchiffren===
 +
{| {{prettytable}}
 +
| align="center" style="background:#f0f0f0;"|'''name'''
 +
| align="center" style="background:#f0f0f0;"|'''variant'''
 +
| align="center" style="background:#f0f0f0;"|'''language'''
 +
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''keysize (bits)'''
 +
| align="center" style="background:#f0f0f0;"|'''output size (bits)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (initialisation)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (generation)'''
 +
| align="center" style="background:#f0f0f0;"|'''attacks'''
 +
| align="center" style="background:#f0f0f0;"|'''paper'''
 +
| align="center" style="background:#f0f0f0;"|'''license / patents'''
 
|-
 
|-
| DES||C||C||2480||0||||56||64||||||||||||
+
| ARCFOUR||C||C|| ||258|| ||0 – 2040||8|| || || || || ||
 
|-
 
|-
| TDES||C||C||2480||0||||168||64||0||852082||852107||||||
+
| ARCFOUR||Asm||Asm||122||258|| ||0 – 2040||8|| || || || || ||
 
|-
 
|-
| Serpent||Non-bitslice||C||||528||||1 – 256||128||||||||||||
+
| Trivium||C||C||424||36|| ||80||1|| || || || || ||
 
|-
 
|-
| Serpent||bitslice||C||4498||||||||||102098||70827||70462||||||
+
| Grain||C||C||778||20|| ||80||1|| || || || || ||
 +
|}
 +
 
 +
===Hashes===
 +
{| {{prettytable}}
 +
| align="center" style="background:#f0f0f0;"|'''name'''
 +
| align="center" style="background:#f0f0f0;"|'''variant'''
 +
| align="center" style="background:#f0f0f0;"|'''language'''
 +
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''hashsize (bits)'''
 +
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (initialsation)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (per block)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (finalisation)'''
 +
| align="center" style="background:#f0f0f0;"|'''attacks'''
 +
| align="center" style="background:#f0f0f0;"|'''paper'''
 +
| align="center" style="background:#f0f0f0;"|'''license / patents'''
 
|-
 
|-
| Skipjack||C||C||1244||0||||80||64||||||||||||
+
| SHA-256||C ||C ||   ||40|| ||256||512|| || || || || ||
 
|-
 
|-
| Present||C||C||1514||256||||80||64||30395||105796||151624||||||
+
| SHA-256||Asm||Asm||1600||40|| ||256||512|| || || || || ||
 
|-
 
|-
| SEED||C||C||||16||||128||128||||||||||||
+
| SHA-1  ||C ||C ||   ||28|| ||160||512|| || || || || ||
 
|-
 
|-
| SEED||C+Asm||C+Asm||4052||||||||||||||||||||
+
| SHA-1  ||Asm||Asm||1072||28|| ||160||512|| || || || || ||
 
|-
 
|-
| XTEA||C||C||||0||||128||64||||||||||||
+
| MD5    ||C ||C ||2086||20|| ||128||512|| || || || || ||
 +
|}
 +
 
 +
===MACs===
 +
{| {{prettytable}}
 +
| align="center" style="background:#f0f0f0;"|'''name'''
 +
| align="center" style="background:#f0f0f0;"|'''variant'''
 +
| align="center" style="background:#f0f0f0;"|'''language'''
 +
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''keysize (bits)'''
 +
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (initialisation)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (per block)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (finalisation)'''
 +
| align="center" style="background:#f0f0f0;"|'''attacks'''
 +
| align="center" style="background:#f0f0f0;"|'''paper'''
 +
| align="center" style="background:#f0f0f0;"|'''license / patents'''
 
|-
 
|-
| XTEA||Asm||Asm||504||||||||||||||||||||
+
| HMAC-SHA256|| ||C||2712||40|| || any || 512 || || || || || ||
 +
|}
 +
 
 +
===PRNGs===
 +
{| {{prettytable}}
 +
| align="center" style="background:#f0f0f0;"|'''name'''
 +
| align="center" style="background:#f0f0f0;"|'''variant'''
 +
| align="center" style="background:#f0f0f0;"|'''language'''
 +
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
 +
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (input)'''
 +
| align="center" style="background:#f0f0f0;"|'''time (output)'''
 +
| align="center" style="background:#f0f0f0;"|'''attacks'''
 +
| align="center" style="background:#f0f0f0;"|'''paper'''
 +
| align="center" style="background:#f0f0f0;"|'''license / patents'''
 
|-
 
|-
| Shabea||C||C||2020||0||||0 – infinit||256||||||||||||
+
| Entropium|| ||C||2174||64|| ||256|| || || || || ||
 
|}
 
|}

Version vom 20. April 2008, 01:54 Uhr


Where can I find it?

SVN: [1]

via Track (also svn, but suitable for direct browsing):[2]

Short Facts

  • small implementation of cryptographic algorithms in C (quite protable)
  • even smaller implementations in assembly language (ATmega, gnu-avr-as)
  • license: GPLv2 & GPLv3 (nearly everything)


About

Crypto-avr-lib is a set of implementations of different cryptographic primitives. Due to the special limitations of microcontrollers (very raw space, RAM and flash are ranging from a few bytes to a few KiB) reference or "normal" optimised implementations are not useable. Therefor we try to provide special implementations which respect the extrem limited resources of microcontroller applications.

What should be done

symmetric

block aes cast6 twofish idea kasumi
stream seal A5/1 Turing Rabbit
hashes ripemd whirlpool

What we have

symmetric

block

  • XTEA
  • CAST5
  • Camellia
  • Skipjack
  • Noekeon
  • RC5
  • RC6
  • SEED
  • DES
  • TDES (aka EDE-DES, 3DES)
  • SHABEA
  • Serpent
  • Present

stream

  • ARCFOUR (RC4 kompatibel)
  • Trivium
  • Grain

hashes

  • SHA-256
  • SHA-1
  • MD5

others

  • HMAC-SHA256 (nach RFC 2104)
  • PRNG

Facts

Blockchiffren

name variant language size (flash) (bytes) size (context) (bytes) size (stack) (bytes) keysize (bits) blocksize (bits) time (initalisation) time (encrypt) time (decrypt) attacks paper license / patents
Camellia C C 32 128 128
Camellia C+Asm C+Asm 5803 32 128 128
Cast5 C C 14108 75 0-128 64 13739 12550 13109
RC5 RC5-32/r/b C 1524 3+(8*#Runden+1) 1 – 2040 64 79352 7827 7223
RC6 RC6-32/r/b C 2656 19+(8*#Runden) 1 – 2040 128 139940 26600 25986
Noekeon C C 0 (16) 128 128
Noekeon Asm Asm 870 0 (16) 128 128 10566 10340 10895
DES C C 2480 0 56 64
TDES C C 2480 0 168 64 0 852082 852107
Serpent Non-bitslice C 528 1 – 256 128
Serpent bitslice C 4498 528 1-256 128 102098 70827 70462
Skipjack C C 1244 0 80 64
Present C C 1514 256 80 64 30395 105796 151624
SEED C C 16 128 128
SEED C+Asm C+Asm 4052 16 128 128
XTEA C C 0 128 64
XTEA Asm Asm 504 0 128 64
Shabea C C 2020 0 0 – infinit 256

Stromchiffren

name variant language size (flash) (bytes) size (context) (bytes) size (stack) (bytes) keysize (bits) output size (bits) time (initialisation) time (generation) attacks paper license / patents
ARCFOUR C C 258 0 – 2040 8
ARCFOUR Asm Asm 122 258 0 – 2040 8
Trivium C C 424 36 80 1
Grain C C 778 20 80 1

Hashes

name variant language size (flash) (bytes) size (context) (bytes) size (stack) (bytes) hashsize (bits) blocksize (bits) time (initialsation) time (per block) time (finalisation) attacks paper license / patents
SHA-256 C C 40 256 512
SHA-256 Asm Asm 1600 40 256 512
SHA-1 C C 28 160 512
SHA-1 Asm Asm 1072 28 160 512
MD5 C C 2086 20 128 512

MACs

name variant language size (flash) (bytes) size (context) (bytes) size (stack) (bytes) keysize (bits) blocksize (bits) time (initialisation) time (per block) time (finalisation) attacks paper license / patents
HMAC-SHA256 C 2712 40 any 512

PRNGs

name variant language size (flash) (bytes) size (context) (bytes) size (stack) (bytes) blocksize (bits) time (input) time (output) attacks paper license / patents
Entropium C 2174 64 256