Encryption for Programmers - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

Encryption for Programmers

Description:

First for signing and encryption. 1973 Clifford Cocks, GCHQ ... http://www.wassenaar.org. Questions? Contact me. riscphree_at_gmail.com. http://riscit.info ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 35
Provided by: riscp
Category:
Tags: do | encryption | for | how | mail | programmers | sign | up

less

Transcript and Presenter's Notes

Title: Encryption for Programmers


1
Encryption for
Programmers
2
Points of Discussion
  • Intro to Crypto
  • Code vs Cipher
  • Concepts / Examples
  • Legalities

3
Intro To Crypto
  • What is it?
  • Language and math techniques for securing
    information
  • So, what is encryption?
  • Conversion from plaintext to ciphertext
  • Historically used for military purposes
  • Now, digital signatures, voting, cash, etc
  • Everywhere

4
Intro To Crypto
  • Code
  • Substitution
  • Whole words, phrases
  • Cipher
  • Algorithm
  • Normally controlled by key

5
Intro To Crypto
  • Symmetric Key Algorithms
  • Private key
  • ie, DES and AES
  • Asymmetric Key Algorithms
  • Public key
  • ie, RSA

6
Symmetric Key Encryption
  • AKA private key
  • Same key for encryption and decryption
  • Blocks and streams
  • Examples DES, AES, and RC4

7
Blocks and Streams
  • Block cipher, fixed length of bits
  • Transformation controlled by secret key
  • Stream cipher, each bit or byte

8
Asymmetric Key Encryption
  • AKA public key
  • No transfer of secret key
  • 2 keys used
  • Public encryption
  • Private decryption
  • Digital signing
  • DSA and ElGamal

9
Algorithms
  • Alberti, Vigenère, ROT13
  • DES / AES
  • BLOWFISH
  • RSA
  • RC5
  • RC6
  • One Time Pads

10
Alberti, Vigenère, ROT13
  • Polyalphabetic substitution

ABCDEFGHIJKLMNOPQRSTUVWXYZ BCDEFGHIJKLMNOPQRSTUVWX
YZA CDEFGHIJKLMNOPQRSTUVWXYZAB DEFGHIJKLMNOPQRSTUV
WXYZABC EFGHIJKLMNOPQRSTUVWXYZABCD
FGHIJKLMNOPQRSTUVWXYZABCDE GHIJKLMNOPQRSTUVWXYZABC
DEF HIJKLMNOPQRSTUVWXYZABCDEFG IJKLMNOPQRSTUVWXYZA
BCDEFGH JKLMNOPQRSTUVWXYZABCDEFGHI
KLMNOPQRSTUVWXYZABCDEFGHIJ LMNOPQRSTUVWXYZABCDEFGH
IJK MNOPQRSTUVWXYZABCDEFGHIJKL NOPQRSTUVWXYZABCDEF
GHIJKLM...ZABCDEFGHIJKLMNOPQRSTUVWXY
11
Alberti, Vigenère, ROT13
  • 1466 Renaissance scholar
  • 1586 French Diplomat, crypto
  • Good example bad encyption

12
Alberti, Vigenère, ROT13
perl -pe tr/A-Za-z/N-ZA-Mn-za-m/ lt input_file gt
output_file
13
DES
  • DES is insecure
  • First published in 1975 (77 standard)
  • 64 bit block size, 56 bit key size
  • Feistel structure with 16 rounds

14
Feistel
  • Operations are very similar
  • Requires only a reversal of key schedule
  • Repeated operations
  • Bit shuffling (P-boxes)
  • Non-linear functions (S-boxes)
  • Linear mixing using XOR

15
DES
  • Expansion half block is expanded
  • Key mixing result is combined with subkey. 16
    subkeys from key schedule.
  • Substitution block is then divided into 8
    pieces, s-boxes go to work.
  • Permutation outputs are then rearranged to a
    fixed p-box

S1
Half Block
32bit
P-box
.......
Subkey
S8
48bit
16
AES
  • aka Rijndael
  • US Government standard
  • First published in 1998 (2001 standard)
  • 128 bit block, 128, 192, or 256 bit key size
  • Substitution permutation structure
  • 10, 12, and 14 rounds

17
AES
  • 4x4 array, state
  • SubBytes substitution with lookup table
  • ShiftRows transposition
  • MixColumns mix and combine
  • AddRoundKey each byte with key using key
    schedule
  • Final round does not MixColumns

18
AES
Lookup Table
SubBytes
19
AES
ShiftRows
20
AES
MixColumns
c(x)
21
AES
AddRoundKey
22
AES
  • Implementation

http//fp.gladman.plus.com/cryptography_technology
/rijndael/
23
RSA
  • Asymmetric
  • First for signing and encryption
  • 1973 Clifford Cocks, GCHQ
  • 1977 by R. Rivest, A. Shamir, L. Adleman

24
RSA
p 61 (first prime, kept secret or delete) q
53 (second prime, kept secret or delete) n pq
3233 (modulus, public) e 17 (public exponent,
public) d 2753 (private exponent, private)
Public key is (e, n), private key is d. To
encrypt, where m is plaintext encrypt(m) me
mod n m17 mod 3233 To decrypt, where c is
ciphertext decrypt(c) cd mod n c2753 mod
3233 To encrypt plaintext value 123
encrypt(123) 12317 mod 3233 855 To decrypt
ciphertext 855 decrypt(855) 8552753 mod 3233
123
25
RSA
  • Padding schemes
  • m0 or m1 always 0 or 1
  • Low exponents may be less than mod. Thus
    decryption through eth root of ciphertext
  • Digital Signing
  • Hash d mod n x
  • x e mod n hash?

26
BLOWFISH
  • 1993 by Bruce Schneier
  • Block size of 64bit, key size from 32-448 bits
  • Feistel structure with 16 rounds
  • Implementation
  • http//www.schneier.com/blowfish.html

27
BLOWFISH
8 bits
8 bits
8 bits
8 bits
32 bits
32 bits
32 bits
32 bits
28
RC5
  • Block cipher
  • First published 1994, R. Rivest
  • Block size of 32, 64, or 128bit. Key size up to
    2040 bits.
  • Feistel structure, 12 rounds

29
RC6
  • Block cipher
  • R.Rivest,M.Robshaw, R.Sidney, Y.Lisa Yin
  • Block size of 128, key sizes of 128, 192, 256 bit.

30
One Time Pads
  • Vernam Cipher, Unbreakable
  • Plaintext combined with pad
  • Pad has at least same length
  • Drawbacks
  • Random Pads
  • Secure exchange of pad
  • ONE TIME USE
  • Integrity

31
One Time Pads
A0B1Z25
QIADJ
HELLO
H (7) E (4) L (11) L (11) O (14)
JEPSW

J (9) E (4) P (15) S (18) W (21)
Q (16) I (8) A (26) D (29) J (35)
32
One Time Pad
A0B1Z25
HELLO
QIADJ
Q (16) I (8) A (26) D (29) J (35)
JEPSW
-
J (9) E (4) P (15) S (18) W (21)
H (7) E(4) L (11) L (11) O (14)
33
Legal
  • US Import laws none
  • Export Wassenaar Agreement
  • Software is not included as a restricted
    technology if it is "generally available to the
    public" or "in the public domain".
  • http//rechten.uvt.nl/koops/cryptolaw/
  • http//www.wassenaar.org

34
Questions?
Contact me riscphree_at_gmail.com http//riscit.info
Write a Comment
User Comments (0)
About PowerShow.com