SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Encryption Basics
Kevin O'Brien
Washtenaw Linux Users Group
Ancient History
● Wax tablets – Herodotus
● Shaved head – Herodotus
● Both examples of Steganography (hidden writing)
– Steganos (Greek) = hidden
– Graphei (Greek) = writing
● Essentially security by obscurity
● More modern version = microdots
Encryption
● Kryptos (Greek) = hidden
● A message should be unreadable to someone
who finds it
● Employs a cipher
● Substitutes one symbol for another
● Not the same as a code!
Codes
● Codes do not try to obscure the message
● Examples:
– Morse code
– ASCII
● Codes transform one set of symbols into
another without trying to hide the meaning
Caesar Cipher
● Moved each letter a fixed number of spaces
● Same as ROT13
● HAL = IBM
● Not very secure, but then Caesar was dealing
with barbarians :)
● Trivial to break since there are only 25 schemes
to try.
Substitution Cipher
● Better than Caesar Cipher
● No fixed pattern to how symbols are substituted
● Think of the “brain teaser” puzzles in the
newspaper
● Obviously, these can be broken by ordinary
people with small effort
Statistical analysis
● The weakness of Substitution Ciphers is that
they are susceptible to statistical analysis
●
First shown by Al-Kindi in the 9th
century
● In English, letters have a certain frequency
– e,t,a,o,i,n,s,h,r,d,l,u....
● Letter q almost always followed by u, “the” is
most common three-letter word, and so on
Vigenere Square
● Uses a key word or phrase to create a different
substitution for each letter of the message
● But if reused could also be analyzed
● Charles Babbage showed that it could be
attacked statistically
One-Time Pads
● A series of unique Vigenere Squares
● Each one is used only once
● Absolutely secure
● But pain the butt to create
● And distribution is an issue
● If enemy gets it, no security
Mechanical solutions
● Captain Midnight Decoder Ring
● Rotate one disk against another
● Essentially just another Caesar Cipher
Enigma
● Decoder ring on steroids
● Multiple disks
● Settings change after each letter
● Poles figured out how to analyze
● Passed to Brits
● Bletchley Park & Turing
Enigma flawed
● First, essentially mechanical means there is a
way to attack
● Mechanical cannot be truly random
● No letter could be encrypted as itself
● Key turned out to be mathematics
Computers
● Originally created to break ciphers
● Collosus used against German Lorenz Cipher
● But computers could be used to create ciphers
as well
● By the 1960s it was clear that computers could
create unbreakable encryption schemes as
long users did not make a mistake
Key distribution
● But how to distribute keys securely?
● Same issue as with one-time pads
● Whitfield Diffie, Martin Hellman, and Ralph
Merkle solved that and created Diffie-Hellman-
Merkle Key Exchange
● Diffie later realized that publicly distributed keys
could be asymmetric
RSA
● Ron Rivest, Adi Shamior, and Leonard Adelman first
figured out how to do it practically
● Based on one-way function
● Easy to compute, impractical to reverse
● They used large prime numbers which they multiplied
together to get an even larger number
● Extremely large numbers are hard to factor, hence
the one-way
Key Pair
● RSA procedure creates two keys
● Each key can decrypt what the other key has
encrypted
● But no key can decrypt what it itself has
encrypted
Other Algorithms
● In addition to the RSA prime number algorithm
there are two well-known alternatives
● Discrete Logarithm
● Elliptical Curve
● Both are also “one-way” functions that are easy
to compute but impractical to reverse
Symmetric vs. Asymmetric Encryption
● Symmetric means the same key that encrypted
the message will also decrypt it
● Very efficient = can easily and quickly encrypt
and decrypt
● Key distribution is a problem
● Alice has to send Bob the key before sending
the encrypted message
● Eve can listen in and get the key
Public Key
● This is Asymmetric
● A key pair is generated
● One of the keys is designated as private, the
other public
● Arbitrary which is which
Key Distribution
● Public key gets around the key distribution
problem
● The Public key can be freely distributed
● But only the Private key can decrypt what the
Public key has encrypted
● But also requires a lot more resources
Symmetric Standard DES
● Data Encryption Standard (DES) developed by
IBM for the U.S. Government
● Employed several techniques still in use today
– Block Cipher
– XOR
● http://en.wikipedia.org/wiki/Data_Encryption_St
andard
Block Cipher
● A Block Cipher operates on a fixed-length block
of bits to transform them
● Plain text is turned into ciphertext block by
block
● Generally the transformation is repeated a
number times called rounds
● https://en.wikipedia.org/wiki/Block_cipher
XOR
● Most common transformation
● Stands for “Exclusive Or”
● In logic, means that either A is true or B is true,
but not both
● In circuit design, if either A or B is sending a
signal it is output, but if both are, nothing is
output
XOR in Cryptography
● The message and the key are expressed in
binary
● They are XORed together
● This essentially means adding without carrying
the 1
● If both A and B are 0, or both are 1, the result is
0. If one is zero and the other is 1, the result is
1
Coding
● Remember that a code is just a transparent
transform of information from one scheme to
another
● ASCII is such a code
● It takes letters and symbols and turns them into
binary numbers
● http://en.wikipedia.org/wiki/ASCII
Coding Example 1
● I want to send a message “cat”
● C=1100011
● A=1100001
● T=1110100
● CAT=110001111000011110100
● This is still transparent
Key
● Now I will choose a key to use, and I choose
“dog”
● D=1100100
● 0=1101111
● G=1100111
● DOG=110010011011111100111
XOR
XOR is reversible
● If you take the result text from the example, and
XOR it with the key, you get back the original
message
Encryption Algorithm
● Combines a number of transformations and
combines them in rounds
● For symmetric encryption needs to be
reversible
● XOR is always part of the process
DES
● Block size was initially 64-bits
● But one bit from each byte was devoted to
parity checking
● Effective length 56-bits, therefore
DES role
● Bruce Schneier said about it “”DES did more to
galvanize the field of cryptanalysis than
anything else. Now there was an algorithm to
study.”
● Standard against which all others were
compared
● Key length just too small
● Cracked in 22 hours in 1999
Triple DES
● Uses 3 independent 56-bit keys in a repeated
process
● Each block encrypted three times, once with
each key
● Probably safe for now
AES
● Advanced Encryption Standard
● Adopted in 2001 by NIST
● Considered best symmetric algorithm available
now
Rijndael Cipher
● Named for developers, Vincent Rijman and Joan
Daeman
● Basis of AES
● Block size of 128-bits
● Key sizes of 128, 192, or 256 bits are allowed
● Called AES-128, AES192, or AES-256
● As with all other algorithms, repeated rounds of
transformations
Symmetric Summed Up
● Fast and efficient
● Relies on a single shared key
● Does not require entropy because the key
needs only to be agreed, not random
Asymmetric Standards
● Solve the key distribution problem
● Requires entropy (randomness) along with one-
way functions
● Three kinds
– Multiplying large prime numbers
– Discrete logarithm
– Elliptic Curve
Prime Number Approach
● This is what RSA uses
● Two large prime numbers are multiplied together
● This is easy to do
● But factoring the result to get back the original primes
is computationally infeasible with current technology
● But research into factorization is ongoing, it is an
arms race
What numbers?
● Generally in the neighborhood of 1024 digits
● Must be randomly selected
● Should not be “near” each other
● Product is used to generate other prime
numbers which help form the key pair
● One is arbitrarily made private, the other public
Discrete Logarithm
● Involves finding an integer that solves a
logarithmic equation
● Used in Elgamal encryption and Diffie-Hellman-
Merkle Key Exchange
● Choosing the particular numbers for the
logarithmic equation is where the entropy comes in
● Diffie-Hellman-Merkle Key Exchange is used for
Perfect Forward Secrecy
Elliptic Curve
● Builds on Discrete Logarithm approach
● A curve with the right properties is chosen,
then a point on that curve
● Then you need to find the discrete logarithm of
that point
● Entropy comes in when choosing the point on
the curve
Issues with Elliptic Curve
● NIST has recommended 15 curves as suitable
● It appears NSA pushed one with weaknesses
as the default
● But Elliptic Curve done right is faster and more
efficient than RSA or general Discrete
Logarithm approaches
● So it should be the future.
Symmetric vs. Asymmetric
● Symmetric is fast and efficient, but needs no
entropy
● Symmetric has key exchange problems
● Asymmetric is resource-intensive, requires
randomness
● Asymmetric solves key exchange
Hybrid Approach
● Most public key crypto uses Asymmetric
encryption to distribute a Symmetric key
● So the inefficient algorithm is only used at the
beginning
● Everything after that is done with the efficient
Symmetric algorithm
Example: E-mail
● When you encrypt a message to someone, you
use a Symmetric key to encrypt a message
● Then you use their Public key to encrypt the
Symmetric key
● They get the message and use their Private key
to decrypt the Symmetric key
● Then they use the Symmetric key to decrypt the
message
See also
● SSL certificates
● SSH tunnels
● Generally, the same techniques are used over
and over
● So learn it once and you can quickly learn other
uses

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141: 14. Quantum and Post-Quantum
CNIT 141: 14. Quantum and Post-QuantumCNIT 141: 14. Quantum and Post-Quantum
CNIT 141: 14. Quantum and Post-Quantum
 
CNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic CurvesCNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic Curves
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
CNIT 141: 11. Diffie-Hellman
CNIT 141: 11. Diffie-HellmanCNIT 141: 11. Diffie-Hellman
CNIT 141: 11. Diffie-Hellman
 
CNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic SecurityCNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic Security
 
Cryptography
CryptographyCryptography
Cryptography
 
An Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent eAn Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent e
 
Unit 2
Unit 2Unit 2
Unit 2
 
CNIT 141: 2. Randomness
CNIT 141: 2. RandomnessCNIT 141: 2. Randomness
CNIT 141: 2. Randomness
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
Post Quantum Cryptography - Emerging Frontiers
Post Quantum Cryptography - Emerging FrontiersPost Quantum Cryptography - Emerging Frontiers
Post Quantum Cryptography - Emerging Frontiers
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
CNIT 141: 5. Stream Ciphers
CNIT 141: 5. Stream CiphersCNIT 141: 5. Stream Ciphers
CNIT 141: 5. Stream Ciphers
 
Secure 2 Party AES
Secure 2 Party AESSecure 2 Party AES
Secure 2 Party AES
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141 8. Authenticated Encryption
CNIT 141 8. Authenticated EncryptionCNIT 141 8. Authenticated Encryption
CNIT 141 8. Authenticated Encryption
 
An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)
 
Symmetric encryption
Symmetric encryptionSymmetric encryption
Symmetric encryption
 
Cyclic Attacks on the RSA Trapdoor Function
Cyclic Attacks on the RSA Trapdoor FunctionCyclic Attacks on the RSA Trapdoor Function
Cyclic Attacks on the RSA Trapdoor Function
 

Andere mochten auch

Auditing a Wireless Network and Planning for a Secure WLAN Implementation
Auditing a Wireless Network and Planning for a Secure WLAN ImplementationAuditing a Wireless Network and Planning for a Secure WLAN Implementation
Auditing a Wireless Network and Planning for a Secure WLAN Implementation
CARMEN ALCIVAR
 
Intro To Linux
Intro To LinuxIntro To Linux
Intro To Linux
techlug
 
Bash shell
Bash shellBash shell
Bash shell
xylas121
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
patisa
 

Andere mochten auch (20)

Cryptography
CryptographyCryptography
Cryptography
 
TMG Intro To Linux
TMG Intro To LinuxTMG Intro To Linux
TMG Intro To Linux
 
Linux Intro
Linux   IntroLinux   Intro
Linux Intro
 
Auditing a Wireless Network and Planning for a Secure WLAN Implementation
Auditing a Wireless Network and Planning for a Secure WLAN ImplementationAuditing a Wireless Network and Planning for a Secure WLAN Implementation
Auditing a Wireless Network and Planning for a Secure WLAN Implementation
 
Intro To Linux
Intro To LinuxIntro To Linux
Intro To Linux
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Linux day 2016 la shell in linux
Linux day 2016   la shell in linuxLinux day 2016   la shell in linux
Linux day 2016 la shell in linux
 
关于Linux的许多
关于Linux的许多关于Linux的许多
关于Linux的许多
 
Encryption Techniques
Encryption TechniquesEncryption Techniques
Encryption Techniques
 
Network secuirty & encryption techniques
Network secuirty & encryption techniquesNetwork secuirty & encryption techniques
Network secuirty & encryption techniques
 
Scripting and the shell in LINUX
Scripting and the shell in LINUXScripting and the shell in LINUX
Scripting and the shell in LINUX
 
Bash shell
Bash shellBash shell
Bash shell
 
Double DES & Triple DES
Double DES & Triple DESDouble DES & Triple DES
Double DES & Triple DES
 
Linux intro 1 definitions
Linux intro 1  definitionsLinux intro 1  definitions
Linux intro 1 definitions
 
Ubuntu – Linux Useful Commands
Ubuntu – Linux Useful CommandsUbuntu – Linux Useful Commands
Ubuntu – Linux Useful Commands
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Operating Systems: Linux in Detail
Operating Systems: Linux in DetailOperating Systems: Linux in Detail
Operating Systems: Linux in Detail
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 

Ähnlich wie Encryption basics

CISSP Week 18
CISSP Week 18CISSP Week 18
CISSP Week 18
jemtallon
 

Ähnlich wie Encryption basics (20)

CNIT 125 Ch 4. Security Engineering (Part 2)
CNIT 125 Ch 4. Security Engineering (Part 2)CNIT 125 Ch 4. Security Engineering (Part 2)
CNIT 125 Ch 4. Security Engineering (Part 2)
 
Chapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutanChapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutan
 
CISSP Week 18
CISSP Week 18CISSP Week 18
CISSP Week 18
 
CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)
 
Cryptography-101
Cryptography-101Cryptography-101
Cryptography-101
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
Ch 12: Cryptography
Ch 12: CryptographyCh 12: Cryptography
Ch 12: Cryptography
 
CNIT 123 12: Cryptography
CNIT 123 12: CryptographyCNIT 123 12: Cryptography
CNIT 123 12: Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Securing your Bitcoin wallet
Securing your Bitcoin walletSecuring your Bitcoin wallet
Securing your Bitcoin wallet
 
Class3
Class3Class3
Class3
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptx
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
 
AES-GCM common pitfalls and how to work around them.pptx
AES-GCM common pitfalls and how to work around them.pptxAES-GCM common pitfalls and how to work around them.pptx
AES-GCM common pitfalls and how to work around them.pptx
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
 
RSA
RSARSA
RSA
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
 
Cryptography
CryptographyCryptography
Cryptography
 
Rsa
RsaRsa
Rsa
 

Mehr von Kevin OBrien

Mehr von Kevin OBrien (20)

American icon pmi
American icon   pmiAmerican icon   pmi
American icon pmi
 
Tls 1.3
Tls 1.3Tls 1.3
Tls 1.3
 
Forward Secrecy
Forward SecrecyForward Secrecy
Forward Secrecy
 
Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key Exchange
 
Password best practices and the last pass hack
Password best practices and the last pass hackPassword best practices and the last pass hack
Password best practices and the last pass hack
 
SSL certificates
SSL certificatesSSL certificates
SSL certificates
 
Passwords
PasswordsPasswords
Passwords
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery Commands
 
Help, my computer is sluggish
Help, my computer is sluggishHelp, my computer is sluggish
Help, my computer is sluggish
 
The ps Command
The ps CommandThe ps Command
The ps Command
 
Installing Software, Part 3: Command Line
Installing Software, Part 3: Command LineInstalling Software, Part 3: Command Line
Installing Software, Part 3: Command Line
 
Installing Software, Part 2: Package Managers
Installing Software, Part 2: Package ManagersInstalling Software, Part 2: Package Managers
Installing Software, Part 2: Package Managers
 
Installing Software, Part 1 - Repositories
Installing Software, Part 1 - RepositoriesInstalling Software, Part 1 - Repositories
Installing Software, Part 1 - Repositories
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System Considerations
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig Command
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two Commands
 
The Shell Game Part 4: Bash Shortcuts
The Shell Game Part 4: Bash ShortcutsThe Shell Game Part 4: Bash Shortcuts
The Shell Game Part 4: Bash Shortcuts
 
The Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to BashThe Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to Bash
 
The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Encryption basics

  • 2. Ancient History ● Wax tablets – Herodotus ● Shaved head – Herodotus ● Both examples of Steganography (hidden writing) – Steganos (Greek) = hidden – Graphei (Greek) = writing ● Essentially security by obscurity ● More modern version = microdots
  • 3. Encryption ● Kryptos (Greek) = hidden ● A message should be unreadable to someone who finds it ● Employs a cipher ● Substitutes one symbol for another ● Not the same as a code!
  • 4. Codes ● Codes do not try to obscure the message ● Examples: – Morse code – ASCII ● Codes transform one set of symbols into another without trying to hide the meaning
  • 5. Caesar Cipher ● Moved each letter a fixed number of spaces ● Same as ROT13 ● HAL = IBM ● Not very secure, but then Caesar was dealing with barbarians :) ● Trivial to break since there are only 25 schemes to try.
  • 6. Substitution Cipher ● Better than Caesar Cipher ● No fixed pattern to how symbols are substituted ● Think of the “brain teaser” puzzles in the newspaper ● Obviously, these can be broken by ordinary people with small effort
  • 7. Statistical analysis ● The weakness of Substitution Ciphers is that they are susceptible to statistical analysis ● First shown by Al-Kindi in the 9th century ● In English, letters have a certain frequency – e,t,a,o,i,n,s,h,r,d,l,u.... ● Letter q almost always followed by u, “the” is most common three-letter word, and so on
  • 8. Vigenere Square ● Uses a key word or phrase to create a different substitution for each letter of the message ● But if reused could also be analyzed ● Charles Babbage showed that it could be attacked statistically
  • 9. One-Time Pads ● A series of unique Vigenere Squares ● Each one is used only once ● Absolutely secure ● But pain the butt to create ● And distribution is an issue ● If enemy gets it, no security
  • 10. Mechanical solutions ● Captain Midnight Decoder Ring ● Rotate one disk against another ● Essentially just another Caesar Cipher
  • 11. Enigma ● Decoder ring on steroids ● Multiple disks ● Settings change after each letter ● Poles figured out how to analyze ● Passed to Brits ● Bletchley Park & Turing
  • 12. Enigma flawed ● First, essentially mechanical means there is a way to attack ● Mechanical cannot be truly random ● No letter could be encrypted as itself ● Key turned out to be mathematics
  • 13. Computers ● Originally created to break ciphers ● Collosus used against German Lorenz Cipher ● But computers could be used to create ciphers as well ● By the 1960s it was clear that computers could create unbreakable encryption schemes as long users did not make a mistake
  • 14. Key distribution ● But how to distribute keys securely? ● Same issue as with one-time pads ● Whitfield Diffie, Martin Hellman, and Ralph Merkle solved that and created Diffie-Hellman- Merkle Key Exchange ● Diffie later realized that publicly distributed keys could be asymmetric
  • 15. RSA ● Ron Rivest, Adi Shamior, and Leonard Adelman first figured out how to do it practically ● Based on one-way function ● Easy to compute, impractical to reverse ● They used large prime numbers which they multiplied together to get an even larger number ● Extremely large numbers are hard to factor, hence the one-way
  • 16. Key Pair ● RSA procedure creates two keys ● Each key can decrypt what the other key has encrypted ● But no key can decrypt what it itself has encrypted
  • 17. Other Algorithms ● In addition to the RSA prime number algorithm there are two well-known alternatives ● Discrete Logarithm ● Elliptical Curve ● Both are also “one-way” functions that are easy to compute but impractical to reverse
  • 18. Symmetric vs. Asymmetric Encryption ● Symmetric means the same key that encrypted the message will also decrypt it ● Very efficient = can easily and quickly encrypt and decrypt ● Key distribution is a problem ● Alice has to send Bob the key before sending the encrypted message ● Eve can listen in and get the key
  • 19. Public Key ● This is Asymmetric ● A key pair is generated ● One of the keys is designated as private, the other public ● Arbitrary which is which
  • 20. Key Distribution ● Public key gets around the key distribution problem ● The Public key can be freely distributed ● But only the Private key can decrypt what the Public key has encrypted ● But also requires a lot more resources
  • 21. Symmetric Standard DES ● Data Encryption Standard (DES) developed by IBM for the U.S. Government ● Employed several techniques still in use today – Block Cipher – XOR ● http://en.wikipedia.org/wiki/Data_Encryption_St andard
  • 22. Block Cipher ● A Block Cipher operates on a fixed-length block of bits to transform them ● Plain text is turned into ciphertext block by block ● Generally the transformation is repeated a number times called rounds ● https://en.wikipedia.org/wiki/Block_cipher
  • 23. XOR ● Most common transformation ● Stands for “Exclusive Or” ● In logic, means that either A is true or B is true, but not both ● In circuit design, if either A or B is sending a signal it is output, but if both are, nothing is output
  • 24. XOR in Cryptography ● The message and the key are expressed in binary ● They are XORed together ● This essentially means adding without carrying the 1 ● If both A and B are 0, or both are 1, the result is 0. If one is zero and the other is 1, the result is 1
  • 25. Coding ● Remember that a code is just a transparent transform of information from one scheme to another ● ASCII is such a code ● It takes letters and symbols and turns them into binary numbers ● http://en.wikipedia.org/wiki/ASCII
  • 26. Coding Example 1 ● I want to send a message “cat” ● C=1100011 ● A=1100001 ● T=1110100 ● CAT=110001111000011110100 ● This is still transparent
  • 27. Key ● Now I will choose a key to use, and I choose “dog” ● D=1100100 ● 0=1101111 ● G=1100111 ● DOG=110010011011111100111
  • 28. XOR
  • 29. XOR is reversible ● If you take the result text from the example, and XOR it with the key, you get back the original message
  • 30. Encryption Algorithm ● Combines a number of transformations and combines them in rounds ● For symmetric encryption needs to be reversible ● XOR is always part of the process
  • 31. DES ● Block size was initially 64-bits ● But one bit from each byte was devoted to parity checking ● Effective length 56-bits, therefore
  • 32. DES role ● Bruce Schneier said about it “”DES did more to galvanize the field of cryptanalysis than anything else. Now there was an algorithm to study.” ● Standard against which all others were compared ● Key length just too small ● Cracked in 22 hours in 1999
  • 33. Triple DES ● Uses 3 independent 56-bit keys in a repeated process ● Each block encrypted three times, once with each key ● Probably safe for now
  • 34. AES ● Advanced Encryption Standard ● Adopted in 2001 by NIST ● Considered best symmetric algorithm available now
  • 35. Rijndael Cipher ● Named for developers, Vincent Rijman and Joan Daeman ● Basis of AES ● Block size of 128-bits ● Key sizes of 128, 192, or 256 bits are allowed ● Called AES-128, AES192, or AES-256 ● As with all other algorithms, repeated rounds of transformations
  • 36. Symmetric Summed Up ● Fast and efficient ● Relies on a single shared key ● Does not require entropy because the key needs only to be agreed, not random
  • 37. Asymmetric Standards ● Solve the key distribution problem ● Requires entropy (randomness) along with one- way functions ● Three kinds – Multiplying large prime numbers – Discrete logarithm – Elliptic Curve
  • 38. Prime Number Approach ● This is what RSA uses ● Two large prime numbers are multiplied together ● This is easy to do ● But factoring the result to get back the original primes is computationally infeasible with current technology ● But research into factorization is ongoing, it is an arms race
  • 39. What numbers? ● Generally in the neighborhood of 1024 digits ● Must be randomly selected ● Should not be “near” each other ● Product is used to generate other prime numbers which help form the key pair ● One is arbitrarily made private, the other public
  • 40. Discrete Logarithm ● Involves finding an integer that solves a logarithmic equation ● Used in Elgamal encryption and Diffie-Hellman- Merkle Key Exchange ● Choosing the particular numbers for the logarithmic equation is where the entropy comes in ● Diffie-Hellman-Merkle Key Exchange is used for Perfect Forward Secrecy
  • 41. Elliptic Curve ● Builds on Discrete Logarithm approach ● A curve with the right properties is chosen, then a point on that curve ● Then you need to find the discrete logarithm of that point ● Entropy comes in when choosing the point on the curve
  • 42. Issues with Elliptic Curve ● NIST has recommended 15 curves as suitable ● It appears NSA pushed one with weaknesses as the default ● But Elliptic Curve done right is faster and more efficient than RSA or general Discrete Logarithm approaches ● So it should be the future.
  • 43. Symmetric vs. Asymmetric ● Symmetric is fast and efficient, but needs no entropy ● Symmetric has key exchange problems ● Asymmetric is resource-intensive, requires randomness ● Asymmetric solves key exchange
  • 44. Hybrid Approach ● Most public key crypto uses Asymmetric encryption to distribute a Symmetric key ● So the inefficient algorithm is only used at the beginning ● Everything after that is done with the efficient Symmetric algorithm
  • 45. Example: E-mail ● When you encrypt a message to someone, you use a Symmetric key to encrypt a message ● Then you use their Public key to encrypt the Symmetric key ● They get the message and use their Private key to decrypt the Symmetric key ● Then they use the Symmetric key to decrypt the message
  • 46. See also ● SSL certificates ● SSH tunnels ● Generally, the same techniques are used over and over ● So learn it once and you can quickly learn other uses