340 likes | 353 Views
Web security. Applications. Email electronic commerce electronic voting homework submission E-bank Paper submission. Security Requirments. Authentication : identifying someone (or something) reliably. Proving you are who you say you are. Authorization : permission to access a resource.
E N D
Web security Netprog: Cryptgraphy
Applications • Email • electronic commerce • electronic voting • homework submission • E-bank • Paper submission
Security Requirments • Authentication: identifying someone (or something) reliably. Proving you are who you say you are. • Authorization: permission to access a resource. • Integrity: data has not changed by someone else. • Confidentiality: data is only received by the target
Terminology • Encryption: Scramble data so that only someone with a secret can make sense of the data. • Decryption: Descrambling encrypted data. • DES: Data Encryption Standard: secret key cryptographic function standardized by NBS (NIST). • AES: Advanced Encryption Standard: recent standard for symmetric cryptography
Terminology (cont.) • Secret Key Cryptography: a cryptographic scheme where the same key is used to encrypt and decrypt data. Also called symmetric encryption. • Public Key Cryptography: a cryptographic scheme where different keys are used for encryption and decryption (asymmetric).
Terminology (more!) • Firewall: a network component that separates two networks and (typically) operates in the upper layers of the OSI reference model (Application layer). • Screening Router: a discriminating router that filters packets based on network layer (and sometimes transport layer) protocols and addresses.
Attack types • DoS (denial of service): attempting to disrupt or deny a useful service. • Eavesdropping: interception of a third-party (malicious) host • Modification: changing data • Fabrication: producing data on behalf of another person.
Historical Ciphers • Caesar cipher
Data Encryption Standard (DES) • Designed at IBM in 1975 • Changes suggested by the NSA • Standardized by NIST in 1977 • Official cipher for civilian cryptography • Reviewed by the NSA • Used by CIA • Combines substitutions and permutations • Operates on bits
Feistel Network • Iterative structure • Efficient hardware implementation • Non-linear element F provides security • Multiple rounds provide mixing (diffusion) between the two halves
The AES Cipher - Rijndael • designed by Rijmen-Daemen in Belgium • has 128/192/256 bit keys, 128 bit data • an iterative cipher • treats data in 4 groups of 4 bytes • expands 128-bit key to 4 groups of 4 bytes(larger keys are expanded to more groups) • operates an entire block in every round • round number dependent on key size • designed to be: • resistant against known attacks • speed and code compactness on many CPUs • design simplicity
RSA • by Rivest, Shamir & Adleman of MIT in 1977 • best known & widely used public-key scheme • based on exponentiation in a finite field over integers modulo a prime • exponentiation takes O((log n)3) operations (easy) • uses large integers (eg. 1024 bits) • security due to cost of factoring large numbers
RSA Key Setup Generation of a public/private key pair: • select two large primes at random: p, q • compute the system modulus n = p·q • select at random the encryption key e • (n)=(p-1)(q-1) • where 1<e<(n), gcd(e,(n))=1 • solve following equation to find decryption key d : e·d=1 mod (n) and 0≤d≤n • public encryption key: KU={e,n} • private decryption key: KR={d,n}
RSA Example • Select primes: p=17 & q=11 • Computen = pq =17×11=187 • Compute(n)=(p–1)(q-1)=16×10=160 • Select e : gcd(e,160)=1; choose e=7 • Determine d: de=1 mod 160 and d < 160 Value is d=23 since 23×7=161= 10×160+1 • Public key KU={7,187} • Private key KR={23,187}
RSA Use • to encrypt a message M the sender: • obtains public key of recipient KU={e,n} • computes: C=Me mod n, where 0≤M<n • to decrypt the ciphertext C the owner: • uses the private key KR={d,n} • computes: M=Cd mod n • note that the message M must be smaller than the modulus n
RSA Example cont’d • sample RSA encryption/decryption is: • given message M = 88 (88<187) • encryption: C = 887 mod 187 = 11 • decryption: M = 1123 mod 187 = 88
Public Key Cryptography(a.k.a. asymmetric cryptography) • Each entity has 2 keys: • private key (a secret) • public key (well known).
Using Keys • Private keys are used for decrypting. • Public keys are used for encrypting. encryption plaintext ciphertext public key decryption ciphertext plaintext private key
Digital Signature • Public key cryptography is also used to provide digital signatures. signing plaintext signed message private key verification signed message plaintext public key
Transmitting over an insecure channel. Alice wants to send Bob a private message. Apublicis Alice’s public key. Aprivateis Alice’s private key. Bpublicis Bob’s public key. Bprivateis Bob’s private key.
Hello Bob,Wanna get together? Alice Bob encrypt using Bpublic decrypt using Bprivate
OK Alice,Your place or mine? Alice Bob decrypt using Aprivate encrypt using Apublic
Bob’s Dilemma • Nobody can read the message from Alice, but anyone could produce it. • How does Bob know that the message was really sent from Alice? • Bob may be comforted to know that only Alice can read his reply.
Alice can sign her message! • Alice can create a digital signature and prove she sent the message (or someone with knowledge of her private key). • The signature can be a message digest encrypted with Aprivate.
Revised Scheme Alice Bob Sign with Aprivate check signature using Apublic decrypt using Bprivate encrypt using Bpublic
Another possible problem • Suppose Bill receives a message from Alice including a digital signature. “meet me at the library tonight” • Bill sends the same message to Joe so that it looks like the message came from Alice. • Bill includes the digital signature from the message Alice sent to him. • Joe is convinced Alice sent the message!
Solution? • Always start your messages with: • Dear Bill, • Create a digest from the encrypted message and sign that digest. • There are many other schemes as well.
Secure Protocols • Many application protocols include the use of cryptography as part of the application level protocol. • The cryptographic scheme employed is part of the protocol. • If stronger cryptographic tools become available we need to change the protocol.
SSL and TLS • Secure Sockets Layer (SSL) is a different approach - a new layer is added that provides a secure channel over a TCP only link. • TLS is Transport Layer Security (IETF standard based on SSL).
Application Application SSL SSL TCP TCP IP IP SSL layer
Advantages of SSL/TLS • Independent of application layer • Includes support for negotiated encryption techniques. • easy to add new techniques. • Possible to switch encryption algorithms in the middle of a session.
HTTPS Usage • HTTPS is HTTP running over SSL. • used for most secure web transactions. • HTTPS server usually runs on port 443. • Include notion of verification of server via a certificate. • Central trusted source of certificates.