Ryan: FYS Computational Reasoning Fall 2025
Lecture content licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
RSA starts by generating a "key pair" - one private or secret and one public. So we sometimes write SK and PK
We can encrypt with either one.
We can decrypt with the "other" one only.
RSA (Rivest–Shamir–Adleman) is an asymmetric cryptographic algorithm algorithm used to encrypt and decrypt messages.
Asymmetric means one key is used to encrypt and another is used to decrypt.
Generate RSA Keys
Two kinds of "secret keeping"
I want to create something that only you can read
I want to create something that you can be certain came from me.
"Public Key Cryptography Standards"
Anyone can read it and know it is from me
I'd like a secure session
Here is SPUBKEY
Here is ESPUBKEY(CPUBKEY)
ECPUBKEY("READY")
ESPUBKEY("REQUEST")
ECPUBKEY("RESPONSE")
DCPRIVKEY("READY")
process
DSPRIVKEY("REQUEST")
process
hacker
hacker
Server private key not available to hacker
Client private key not available to hacker
With What We Have So Far
Start with information about yourself
Ask a trustee to validate and confirm
Trustee signs certificate with private key
Recipient uses trustee's public key to decrypt
If result matches certificate then it's valid.
I am Dan.
This IS Dan.
45ab98de7ff7ced213198005adfe
Skey(trustee)
Web connection receives certificate
Browser generates keys and sends public as "session" key, encrypted with server's public key.
Server encrypts web page content with session key.
Browser encrypts content to send with private session key.
Browser decrypts content with private key.
Server decrypts content with session key.
Certificate includes server's public key.
1st letter of first name
3rd letter of first name
3rd letter of last name
1st letter of last name
length of first name
length of last name
dnracdgg
month of birth
date of birth mod 26*
* 1=a, 2=b, ..., 27=a, 28=b, 29=c, 30=d, 31=e
A cryptographic hash (sometimes called ‘digest’) is a kind of ‘signature’ for a text or a data file.
aa58b21b01d6b8a99c1a5856962dbac36c758a79dc0a77c2e013ce2c39ecdc8a
da
ec4f2dbb3b140095550c9afbbb69b5d6fd9e814b9da82fad0b34e9fcbe56f1cb
dan
Nam tristique hendrerit iaculis. Ut quis tortor velit. Proin posuere turpis ac mi tincidunt, id vulputate augue semper. Nulla finibus ex nisi, eget feugiat nisl sollicitudin sit amet. Suspendisse dui lorem, sollicitudin eget sodales vitae, gravida vel libero. Morbi elementum id mi non cursus. Proin hendrerit placerat sapien, ut placerat sapien tincidunt vel. Donec pellentesque justo neque, a faucibus odio rhoncus vitae. Quisque viverra aliquet pulvinar. Mauris porta urna vel porttitor rutrum. Quisque dictum finibus neque, ut convallis augue finibus ac. Suspendisse libero lorem, maximus ac tristique et, gravida eget diam. Donec semper dui metus. Pellentesque lobortis porta commodo. Aenean eu augue ultricies, fringilla augue nec, blandit arcu. Nunc consectetur libero tristique, ornare felis consectetur, tincidunt dolor. Nulla facilisi. Sed et feugiat mauris, ac dapibus leo. Etiam eget accumsan lacus. Nam facilisis tortor vel odio sollicitudin auctor. Maecenas quis vulputate enim. Aliquam condimentum justo leo, in bibendum magna fringilla ac. Phasellus a facilisis lorem. Quisque facilisis leo eros, non ultrices tellus volutpat at. Nulla et leo vehicula tellus egestas luctus sed mollis mauris. Maecenas lobortis nec risus sed convallis. Vivamus sit amet imperdiet quam. Cras maximus dui et pellentesque dignissim.
30293f4f02f784c4166a3e17109f01625bd1bfe97de2e017eebf9d23a55d9caf
A cryptographic hash (aka ‘digest’) is a transformation of a text or a data file into an almost-unique fixed length block of data.
A hash is not ‘encryption’ insofar as it cannot be decrypted back to the original text.
As a ‘one-way’ cryptographic function it can be used on a copy of a document and then compared to a hashed version of an original to verify that the copy is accurate to the original.
an algorithm that generates an almost-unique 256-bit (32-byte) signature for a text input.
Secure Hashing Algorithm 256 bit
only you can read it
How to operate on lots of data? Break it up into blocks. Blocks always same size. Padding.