SlideShare a Scribd company logo
Public Key CryptographyPublic Key Cryptography
Martin Kobetic
Cincom Smalltalk Development
ESUG 2006
Public Key Algorithms
Encryption (RSA)
Key Establishment (RSA, DH)
Signing
Hashes (SHA, MD5)
MACs (HMAC, CBC-MAC)
Digital Signatures (RSA, DSA)
public and private key
hard to compute private from the public
sparse key space => much longer keys
based on hard problems
factoring, discrete logarithm
much slower
RSA, DSA, DH, ElGamal
elliptic curves: ECDSA, ECDH,
provides:
confidentiality
symmetric (secret) key ciphers
same (secret) key => encrypt and decrypt
DES, AES, RC4
asymmetric (public) key ciphers
public key => encrypt
private key => decrypt
RSA,ElGammal
RSA Security, PKCS #1
modulus n = product of 2 large primes p, q
public: e = relatively prime to (p-1)(q-1)
private: d = e-1 mod ((p-1)(q-1))
C = Pe mod n [ P < n ]
P = Cd mod n
small e => faster encryption
keys := RSAKeyGenerator keySize: 512.
alice := RSA new publicKey: keys publicKey.
ctxt := alice encrypt: 'Hello World' asByteArray.
ctxt asHexString
bob := RSA new privateKey: keys privateKey.
(bob decrypt: ctxt) asString
keys := RSAKeyGenerator keySize: 512.
alice := RSA new publicKey: keys publicKey.
msg := 'Hello World' asByteArrayEncoding: # utf8.
msg := alice encrypt: msg.
bob := RSA new privateKey: keys privateKey.
msg := bob decrypt: msg.
msg asStringEncoding: # utf8
public key too slow for bulk encryption
public key => secure symmetric key
symmetric key => bulk encryption
key exchange (RSA)
generate one-time symmetric key
public key => encrypt the symmetric key
key agreement (DH)
parties cooperate to generate a shared secret
key := DSSRandom default byteStream next: 40.
msg := 'Hello World!' asByteArray.
msg := (ARC4 key: key) encrypt: msg.
alice := RSA new publicKey: keys publicKey.
key := alice encrypt: key.
bob := RSA new privateKey: keys privateKey.
key := bob decrypt: key
((ARC4 key: key) decrypt: msg) asString.
shared secret over unprotected channel
http://www.ietf.org/rfc/rfc2631.txt
modulus p: large prime (>=512b)
order q: large prime (>=160b)
generator g: order q mod p
private x: random 1 < x < q - 1
public y: g^ x mod p
public y : other party s y = g^ x (mod p)
shared secret: y ^ x = y^ x (mod p)
gen := DHParameterGenerator m: 160 l: 512.
alice := DH p: gen p q: gen q g: gen g.
ya := alice publicValue.
bob := DH p: alice p q: alice q g: alice g.
yb := bob publicValue.
ss := bob sharedSecretUsing: ya
ss = (alice sharedSecretUsing: yb)
bob := DH newFrom: gen.
yb := bob publicValue.
alice := DH newFrom: gen.
ya := alice publicValue.
ss := (alice sharedSecretUsing: yb) asByteArray.
msg := 'Hello World!' asByteArray.
msg := (ARC4 key: ss) encrypt: msg.
ss := (bob sharedSecretUsing: ya) asByteArray.
((ARC4 key: ss) decrypt: msg) asString.
Provides:
integrity (tamper evidence)
authentication
non-repudiation
Hashes (SHA, MD5)
Digital Signatures (RSA, DSA)
provides:
data fingerprinting
unlimited input size => fixed output size
must be:
one-way: h(m) => m
collision resistant: m1,m2 => h(m1) = h(m2)
MD2, MD4, MD5, SHA, RIPE-MD
compression function:
M = M1, M2,
hi = f(Mi, hi-1)
MD-strengthening:
include message length (in the padding)
doesn t completely prevent length extension
http://www.ietf.org/rfc/rfc1321.txt
(Ron Rivest)
digest: 128-bits (16B)
block: 512-bits (64B)
padding: M | 10...0 | length (64bits)
broken in 2004, avoid MD5!
(MD5 hash: 'Hello' asByteArray) asHexString
(MD5 hash: # [1 2 3 4 5] from: 2 to: 4) asHexString
input := # [1 2 3 4 5 6 7 8 9] readStream.
(MD5 hashNext: 3 from: input) asHexString
(MD5 hashFrom: input) asHexString
SHS - NIST FIPS PUB 180
digest: 160 bits (20B)
block: 512 bits (64B)
padding: M | 10...0 | length (64bits)
FIPS 180-1: SHA-1 (1995)
FIPS 180-2: SHA-256, 384, 512 (2002)
SHA-1 broken in 2005!
input := 'Hello World!' asByteArray readStream.
sha := SHA new.
sha updateWithNext: 5 from: input.
sha digest asHexString.
sha updateFrom: input.
sha digest asHexString.
input reset.
(SHA256 hashFrom: input) asHexString.
authentic, non-reusable, unalterable
signing
uses the private key
message, key => signature
verification
uses the public key
message, key, signature => true/false
signing:
hash the plaintext
encode digest
encrypt digest with private key
verifying:
decrypt digest with public key
decode digest
hash the plaintext
compare the digests
alice := RSA new privateKey: keys privateKey.
msg := 'Hello World' asByteArray.
sig := alice sign: msg.
sig asHexString
bob := RSA new publicKey: keys publicKey.
bob verify: sig of: msg
NIST FIPS PUB 186
p prime (modulus): (512 + k* 64 <= 1024)
q prime factor of p 1 (160 bits)
g > 1; g^ q mod p = 1 (g has order q mod p)
x < q (private key)
y = g^ x mod p (public key)
FIPS 186-1 (1998): RSA(X9.31)
FIPS 186-2 (2001): ECDSA(X9.62)
FIPS 186-3 (?2006): bigger keys up to 15K bits
keys := DSAKeyGenerator keySize: 512.
alice := DSA new privateKey: keys privateKey.
sig := alice sign: 'Hello World' asByteArray
bob := DSA new publicKey: keys publicKey.
bob verify: sig of: 'Hello World' asByteArray
[1] Anderson: Security Engineering
[2] Ferguson, Schneier:
Practical Cryptography
[3] Kahn: The Codebreakers
[4] Menezes, van Oorschot, Vanstone:
Handbook of Applied Cryptography
[5] Schneier: Applied Cryptography

More Related Content

What's hot

Apache Commons ソースリーディングの会:Codec
Apache Commons ソースリーディングの会:CodecApache Commons ソースリーディングの会:Codec
Apache Commons ソースリーディングの会:Codec
moai kids
 
0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge
0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge
0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge
Blaine Stancill
 
Native or External?
Native or External?Native or External?
Native or External?
ESUG
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Svetlin Nakov
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Data Con LA
 
Redis - for duplicate detection on real time stream
Redis - for duplicate detection on real time streamRedis - for duplicate detection on real time stream
Redis - for duplicate detection on real time stream
Codemotion
 
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
Dace Barone
 
Paris Redis Meetup Introduction
Paris Redis Meetup IntroductionParis Redis Meetup Introduction
Paris Redis Meetup Introduction
Gregory Boissinot
 
Cybersecurity cyberlab3
Cybersecurity cyberlab3Cybersecurity cyberlab3
Cybersecurity cyberlab3
rayborg
 
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
Svetlin Nakov
 
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Svetlin Nakov
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
amiable_indian
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
Svetlin Nakov
 
Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017
Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017
Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017
Justin Ehrenhofer
 
Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017
Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017
Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017
Justin Ehrenhofer
 
RedisConf17 - Redis as a JSON document store
RedisConf17 - Redis as a JSON document storeRedisConf17 - Redis as a JSON document store
RedisConf17 - Redis as a JSON document store
Redis Labs
 
Redis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesRedis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational Databases
Karel Minarik
 
Password Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP ArgentinaPassword Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP Argentina
Anthony Ferrara
 
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Justin Ehrenhofer
 
Password Storage and Attacking in PHP
Password Storage and Attacking in PHPPassword Storage and Attacking in PHP
Password Storage and Attacking in PHP
Anthony Ferrara
 

What's hot (20)

Apache Commons ソースリーディングの会:Codec
Apache Commons ソースリーディングの会:CodecApache Commons ソースリーディングの会:Codec
Apache Commons ソースリーディングの会:Codec
 
0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge
0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge
0 to 31337 Real Quick: Lessons Learned by Reversing the Flare-On Challenge
 
Native or External?
Native or External?Native or External?
Native or External?
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
 
Redis - for duplicate detection on real time stream
Redis - for duplicate detection on real time streamRedis - for duplicate detection on real time stream
Redis - for duplicate detection on real time stream
 
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
 
Paris Redis Meetup Introduction
Paris Redis Meetup IntroductionParis Redis Meetup Introduction
Paris Redis Meetup Introduction
 
Cybersecurity cyberlab3
Cybersecurity cyberlab3Cybersecurity cyberlab3
Cybersecurity cyberlab3
 
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
 
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
 
Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017
Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017
Monero Presentation by Justin Ehrenhofer - Stockholm, Sweden 2017
 
Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017
Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017
Monero Presentation by Justin Ehrenhofer - Copenhagen, Denmark 2017
 
RedisConf17 - Redis as a JSON document store
RedisConf17 - Redis as a JSON document storeRedisConf17 - Redis as a JSON document store
RedisConf17 - Redis as a JSON document store
 
Redis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesRedis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational Databases
 
Password Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP ArgentinaPassword Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP Argentina
 
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
 
Password Storage and Attacking in PHP
Password Storage and Attacking in PHPPassword Storage and Attacking in PHP
Password Storage and Attacking in PHP
 

Viewers also liked

Tide - The missing web framework
Tide - The missing web frameworkTide - The missing web framework
Tide - The missing web framework
Esteban Lorenzano
 
Voyage by example
Voyage by exampleVoyage by example
Voyage by example
ESUG
 
Advanced Seaside
Advanced SeasideAdvanced Seaside
Advanced Seaside
ESUG
 
MongoTalk/Voyage
MongoTalk/VoyageMongoTalk/Voyage
MongoTalk/Voyage
ESUG
 
Why do *you* need a strong open-source Smalltalk!
Why do *you* need a strong open-source Smalltalk!Why do *you* need a strong open-source Smalltalk!
Why do *you* need a strong open-source Smalltalk!
Pharo
 
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Naruhiko Ogasawara
 

Viewers also liked (6)

Tide - The missing web framework
Tide - The missing web frameworkTide - The missing web framework
Tide - The missing web framework
 
Voyage by example
Voyage by exampleVoyage by example
Voyage by example
 
Advanced Seaside
Advanced SeasideAdvanced Seaside
Advanced Seaside
 
MongoTalk/Voyage
MongoTalk/VoyageMongoTalk/Voyage
MongoTalk/Voyage
 
Why do *you* need a strong open-source Smalltalk!
Why do *you* need a strong open-source Smalltalk!Why do *you* need a strong open-source Smalltalk!
Why do *you* need a strong open-source Smalltalk!
 
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
 

Similar to Cryptography for Smalltalkers 2

Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006
Martin Kobetic
 
Cryptography and SSL in Smalltalk - StS 2003
Cryptography and SSL in Smalltalk - StS 2003Cryptography and SSL in Smalltalk - StS 2003
Cryptography and SSL in Smalltalk - StS 2003
Martin Kobetic
 
introduction to cryptography
introduction to cryptographyintroduction to cryptography
introduction to cryptography
Priyamvada Singh
 
crypto1.ppt
crypto1.pptcrypto1.ppt
crypto1.ppt
tommychauhan
 
crypto.ppt
crypto.pptcrypto.ppt
crypto.ppt
Ganesh Chavan
 
needed.ppt
needed.pptneeded.ppt
needed.ppt
faizalkhan673954
 
introduction to cryptography (basics of it)
introduction to cryptography (basics of it)introduction to cryptography (basics of it)
introduction to cryptography (basics of it)
neonaveen
 
6.hash mac
6.hash mac6.hash mac
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
Erik LaBianca
 
Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...
Codemotion
 
Python Cryptography & Security
Python Cryptography & SecurityPython Cryptography & Security
Python Cryptography & Security
Jose Manuel Ortega Candel
 
TLS/SSL Internet Security Talk
TLS/SSL Internet Security TalkTLS/SSL Internet Security Talk
TLS/SSL Internet Security Talk
Nisheed KM
 
Hashfunction
HashfunctionHashfunction
Hashfunction
Tony Nguyen
 
Hashfunction
HashfunctionHashfunction
Hashfunction
Fraboni Ec
 
Hashfunction
HashfunctionHashfunction
Hashfunction
Young Alista
 
Hashfunction
HashfunctionHashfunction
Hashfunction
Luis Goldster
 
Hash function
Hash functionHash function
Hash function
Harry Potter
 
Hashfunction
HashfunctionHashfunction
Hashfunction
David Hoen
 
Hashfunction
HashfunctionHashfunction
Hashfunction
James Wong
 
Ch12
Ch12Ch12

Similar to Cryptography for Smalltalkers 2 (20)

Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006Cryptography for Smalltalkers 2 - ESUG 2006
Cryptography for Smalltalkers 2 - ESUG 2006
 
Cryptography and SSL in Smalltalk - StS 2003
Cryptography and SSL in Smalltalk - StS 2003Cryptography and SSL in Smalltalk - StS 2003
Cryptography and SSL in Smalltalk - StS 2003
 
introduction to cryptography
introduction to cryptographyintroduction to cryptography
introduction to cryptography
 
crypto1.ppt
crypto1.pptcrypto1.ppt
crypto1.ppt
 
crypto.ppt
crypto.pptcrypto.ppt
crypto.ppt
 
needed.ppt
needed.pptneeded.ppt
needed.ppt
 
introduction to cryptography (basics of it)
introduction to cryptography (basics of it)introduction to cryptography (basics of it)
introduction to cryptography (basics of it)
 
6.hash mac
6.hash mac6.hash mac
6.hash mac
 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...
 
Python Cryptography & Security
Python Cryptography & SecurityPython Cryptography & Security
Python Cryptography & Security
 
TLS/SSL Internet Security Talk
TLS/SSL Internet Security TalkTLS/SSL Internet Security Talk
TLS/SSL Internet Security Talk
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hash function
Hash functionHash function
Hash function
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Ch12
Ch12Ch12
Ch12
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptxAI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
Sunil Jagani
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
manji sharman06
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
Fwdays
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
zjhamm304
 

Recently uploaded (20)

Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptxAI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
 

Cryptography for Smalltalkers 2

  • 1. Public Key CryptographyPublic Key Cryptography Martin Kobetic Cincom Smalltalk Development ESUG 2006
  • 2. Public Key Algorithms Encryption (RSA) Key Establishment (RSA, DH) Signing Hashes (SHA, MD5) MACs (HMAC, CBC-MAC) Digital Signatures (RSA, DSA)
  • 3. public and private key hard to compute private from the public sparse key space => much longer keys based on hard problems factoring, discrete logarithm much slower RSA, DSA, DH, ElGamal elliptic curves: ECDSA, ECDH,
  • 4. provides: confidentiality symmetric (secret) key ciphers same (secret) key => encrypt and decrypt DES, AES, RC4 asymmetric (public) key ciphers public key => encrypt private key => decrypt RSA,ElGammal
  • 5. RSA Security, PKCS #1 modulus n = product of 2 large primes p, q public: e = relatively prime to (p-1)(q-1) private: d = e-1 mod ((p-1)(q-1)) C = Pe mod n [ P < n ] P = Cd mod n small e => faster encryption
  • 6. keys := RSAKeyGenerator keySize: 512. alice := RSA new publicKey: keys publicKey. ctxt := alice encrypt: 'Hello World' asByteArray. ctxt asHexString bob := RSA new privateKey: keys privateKey. (bob decrypt: ctxt) asString
  • 7. keys := RSAKeyGenerator keySize: 512. alice := RSA new publicKey: keys publicKey. msg := 'Hello World' asByteArrayEncoding: # utf8. msg := alice encrypt: msg. bob := RSA new privateKey: keys privateKey. msg := bob decrypt: msg. msg asStringEncoding: # utf8
  • 8. public key too slow for bulk encryption public key => secure symmetric key symmetric key => bulk encryption key exchange (RSA) generate one-time symmetric key public key => encrypt the symmetric key key agreement (DH) parties cooperate to generate a shared secret
  • 9. key := DSSRandom default byteStream next: 40. msg := 'Hello World!' asByteArray. msg := (ARC4 key: key) encrypt: msg. alice := RSA new publicKey: keys publicKey. key := alice encrypt: key. bob := RSA new privateKey: keys privateKey. key := bob decrypt: key ((ARC4 key: key) decrypt: msg) asString.
  • 10. shared secret over unprotected channel http://www.ietf.org/rfc/rfc2631.txt modulus p: large prime (>=512b) order q: large prime (>=160b) generator g: order q mod p private x: random 1 < x < q - 1 public y: g^ x mod p public y : other party s y = g^ x (mod p) shared secret: y ^ x = y^ x (mod p)
  • 11. gen := DHParameterGenerator m: 160 l: 512. alice := DH p: gen p q: gen q g: gen g. ya := alice publicValue. bob := DH p: alice p q: alice q g: alice g. yb := bob publicValue. ss := bob sharedSecretUsing: ya ss = (alice sharedSecretUsing: yb)
  • 12. bob := DH newFrom: gen. yb := bob publicValue. alice := DH newFrom: gen. ya := alice publicValue. ss := (alice sharedSecretUsing: yb) asByteArray. msg := 'Hello World!' asByteArray. msg := (ARC4 key: ss) encrypt: msg. ss := (bob sharedSecretUsing: ya) asByteArray. ((ARC4 key: ss) decrypt: msg) asString.
  • 14. provides: data fingerprinting unlimited input size => fixed output size must be: one-way: h(m) => m collision resistant: m1,m2 => h(m1) = h(m2) MD2, MD4, MD5, SHA, RIPE-MD
  • 15. compression function: M = M1, M2, hi = f(Mi, hi-1) MD-strengthening: include message length (in the padding) doesn t completely prevent length extension
  • 16. http://www.ietf.org/rfc/rfc1321.txt (Ron Rivest) digest: 128-bits (16B) block: 512-bits (64B) padding: M | 10...0 | length (64bits) broken in 2004, avoid MD5!
  • 17. (MD5 hash: 'Hello' asByteArray) asHexString (MD5 hash: # [1 2 3 4 5] from: 2 to: 4) asHexString input := # [1 2 3 4 5 6 7 8 9] readStream. (MD5 hashNext: 3 from: input) asHexString (MD5 hashFrom: input) asHexString
  • 18. SHS - NIST FIPS PUB 180 digest: 160 bits (20B) block: 512 bits (64B) padding: M | 10...0 | length (64bits) FIPS 180-1: SHA-1 (1995) FIPS 180-2: SHA-256, 384, 512 (2002) SHA-1 broken in 2005!
  • 19. input := 'Hello World!' asByteArray readStream. sha := SHA new. sha updateWithNext: 5 from: input. sha digest asHexString. sha updateFrom: input. sha digest asHexString. input reset. (SHA256 hashFrom: input) asHexString.
  • 20. authentic, non-reusable, unalterable signing uses the private key message, key => signature verification uses the public key message, key, signature => true/false
  • 21. signing: hash the plaintext encode digest encrypt digest with private key verifying: decrypt digest with public key decode digest hash the plaintext compare the digests
  • 22. alice := RSA new privateKey: keys privateKey. msg := 'Hello World' asByteArray. sig := alice sign: msg. sig asHexString bob := RSA new publicKey: keys publicKey. bob verify: sig of: msg
  • 23. NIST FIPS PUB 186 p prime (modulus): (512 + k* 64 <= 1024) q prime factor of p 1 (160 bits) g > 1; g^ q mod p = 1 (g has order q mod p) x < q (private key) y = g^ x mod p (public key) FIPS 186-1 (1998): RSA(X9.31) FIPS 186-2 (2001): ECDSA(X9.62) FIPS 186-3 (?2006): bigger keys up to 15K bits
  • 24. keys := DSAKeyGenerator keySize: 512. alice := DSA new privateKey: keys privateKey. sig := alice sign: 'Hello World' asByteArray bob := DSA new publicKey: keys publicKey. bob verify: sig of: 'Hello World' asByteArray
  • 25. [1] Anderson: Security Engineering [2] Ferguson, Schneier: Practical Cryptography [3] Kahn: The Codebreakers [4] Menezes, van Oorschot, Vanstone: Handbook of Applied Cryptography [5] Schneier: Applied Cryptography