Encryption with Generated Keys. Encryption: Symmetric - The same that is used to encrypt the data is also used to decrypt the data. They are all "BLOCK.

Slides:



Advertisements
Similar presentations
Public Key Infrastructure and Applications
Advertisements

“Advanced Encryption Standard” & “Modes of Operation”
Conventional Encryption: Algorithms
Encipherment Using Modern Symmetric-Key Ciphers. 8.2 Objectives ❏ To show how modern standard ciphers, such as DES or AES, can be used to encipher long.
Modern Symmetric-Key Ciphers
Modern Symmetric-Key Ciphers
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Encryption/Decyprtion using RC4 Vivek Ramachandran.
Web Security for Network and System Administrators1 Chapter 4 Encryption.
Cryptography1 CPSC 3730 Cryptography Chapter 6 Triple DES, Block Cipher Modes of Operation.
Chapter 5 Cryptography Protecting principals communication in systems.
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
Security Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to: –Describe the reasons for having system.
EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Security Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to: –Describe the reasons for having system.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering.
Cryptography April 20, 2010 MIS 4600 – MBA © Abdou Illia.
Lecture 23 Symmetric Encryption
Feb 19, 2002Mårten Trolin1 Previous lecture Practical things about the course. Example of cryptosystem — substitution cipher. Symmetric vs. asymmetric.
Chapter 13: Electronic Commerce and Information Security Invitation to Computer Science, C++ Version, Fourth Edition SP09: Contains security section (13.4)
Network Security Chapter
Encryption Methods By: Michael A. Scott
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Hybrid Cipher encryption Plain Text Key Cipher Text Key Plain Text IV Hybrid Cipher decryption Hybrid Cipher Note: IV used in encryption is not used in.
Block and Stream Ciphers1 Reference –Matt Bishop, Computer Security, Addison Wesley, 2003.
1 Chapter 4 Encryption. 2 Objectives In this chapter, you will: Learn the basics of encryption technology Recognize popular symmetric encryption algorithms.
David Froot.  How do we transmit information and data, especially over the internet, in a way that is secure and unreadable by anyone but the sender.
Cryptography in.Net CS 795. Goals Confidentiality---no one else can intercept a message as it passes from A to B---Encryption is the answer Integrity---message.
Block Cipher Transmission Modes CSCI 5857: Encoding and Encryption.
Lecture 23 Cryptography CPE 401 / 601 Computer Network Systems Slides are modified from Jim Kurose & Keith Ross.
Network Security. An Introduction to Cryptography The encryption model (for a symmetric-key cipher).
.Net Security and Performance -has security slowed down the application By Krishnan Ganesh Madras.
Cryptography in.Net Chapters (O’Reilly book) CS 795.
Electronic Mail Security
Cryptography and Network Security Chapter 6. Multiple Encryption & DES  clear a replacement for DES was needed theoretical attacks that can break it.
1 Chapter 3 Ciphers Mechanism that decides the process of encryption/decryption Stream Cipher: Bit-by-bit encryption / decryption Block Cipher: Block-by-block.
Introduction to Stream Cipher Sayed Mahdi Mohammad Hasanzadeh Spring 2004.
Feistel Model Last Updated: Aug 27, Feistel Cipher Structure Described by Horst Feistel (IBM) in 1973 Many symmetric encryption algorithms use this.
Chapter 20 Symmetric Encryption and Message Confidentiality.
Chapter 20 Symmetric Encryption and Message Confidentiality.
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
Day 37 8: Network Security8-1. 8: Network Security8-2 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key:
Block ciphers Structure of a multiround block cipher
1 Securing Data and Communication. 2 Module - Securing Data and Communication ♦ Overview Data and communication over public networks like Internet can.
Cryptography Chapter 7 Part 2 Pages 781 to 812. Symmetric Cryptography Secret Key Figure 7-10 on page 782 Key distribution problem – Secure courier Many.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Chapter 9: Algorithms Types and Modes Dulal C. Kar Based on Schneier.
Feb 17, 2003Mårten Trolin1 Previous lecture Practical things about the course. Example of cryptosystem — substitution cipher. Symmetric vs. asymmetric.
Shambhu Upadhyaya Security – AES-CCMP Shambhu Upadhyaya Wireless Network Security CSE 566 (Lecture 13)
Modes of Usage Dan Fleck CS 469: Security Engineering These slides are modified with permission from Bill Young (Univ of Texas) 11 Coming up: Modes of.
Modes of Operation INSTRUCTOR: DANIA ALOMAR. Modes of Operation A block cipher can be used in various methods for data encryption and decryption; these.
Wired Equivalent Privacy (WEP): The first ‘confidentiality’ algorithm for the wireless IEEE standard. PRESENTED BY: Samuel Grush and Barry Preston.
 Cryptography is the science of using mathematics to encrypt and decrypt data.  Cryptography enables you to store sensitive.
Lecture 23 Symmetric Encryption
Ln Lou Modern Cyphers. 0. Security System Key Plain Text Cipher Text Encryption (K × P → C) Decryption (K × C → P)
1 Symmetric key cryptography: DES DES: Data Encryption Standard US encryption standard [NIST 1993] 56-bit symmetric key, 64 bit plaintext input How secure.
Symmetric Encryption Lesson Introduction ●Block cipher primitives ●DES ●AES ●Encrypting large message ●Message integrity.
Chapter 2 Symmetric Encryption.
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
Cryptography.
© Copyright 2009 SSLPost 01. © Copyright 2009 SSLPost 02 a recipient is sent an encrypted that contains data specific to that recipient the data.
Cipher Transmission and Storage Modes Part 2: Stream Cipher Modes CSCI 5857: Encoding and Encryption.
CSE 5/7353 – January 25 th 2006 Cryptography. Conventional Encryption Shared Key Substitution Transposition.
Encryption Encryption: Transforms Message so that Interceptor Cannot Read it –Plaintext (original message) Not necessarily text; Can be graphics, etc.
Cryptography in .Net CS 795.
Exercise 1: Let’s Communicate - Decrypt The message
Objectives Explain symmetric encryption.
Elect. Codebook, Cipher Block Chaining
Presentation transcript:

Encryption with Generated Keys. Encryption: Symmetric - The same that is used to encrypt the data is also used to decrypt the data. They are all "BLOCK CIPHERS" Take unencrypted data and break it into blocks of all the same size. Each block is encrypted. "CIPHER BLOCK CHAINING" Each Block is combined with the previous blocks encryption. "INITIALIZATION VECTOR" (IV) Data starting point Must be stored like the key. Use symmetric when the same application encrypts and decrypts the data..NET algorithms (System.Security.Cryptography, SymmetricAlgorithm class) Data Encryption Standard (DES) Triple Data Encryption Algorithm (3DES/TDEA) RC2 Rijndael/Advanced Encryption Standard (AES) aesManaged classes

Encryption with Generated Keys. Encryption: Symmetric cont'd- Generating Keys RNGCryptoServiceProvider class (hashing) Minimum and maximum key sizes (LegalKeySizes property) DES: bits 3DES: bits RC2: bits AES: bits 128 (standard for SSL) is usually sufficient Initialization Vectors Size = to block size (BlockSize property) protected void FillOutDetailFields(SymmetricAlgorithm symmetricAlgorithm) { this.keySize.Text = symmetricAlgorithm.KeySize.ToString(); this.blockSize.Text = symmetricAlgorithm.BlockSize.ToString(); this.key.Text = Convert.ToBase64String(symmetricAlgorithm.Key); this.initializationVector.Text = Convert.ToBase64String(symmetricAlgorithm.IV); }

Encryption with Generated Keys. Encryption: Symmetric cont'd- Generating Keys protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { SymmetricAlgorithm symmetricAlgorithm = this.CreateSymmetricAlgorithm(this.algorithm.Text); this.FillOutDetailFields(symmetricAlgorithm); } static byte[] GenerateRandomBytes(int length) { byte[] key = new byte[length]; RNGCryptoServiceProvider provider = new RNGCryptoServiceProvider(); provider.GetBytes(key); return key; }

Encryption with Generated Keys. Encryption: 1. Choose an Algorithm SymmetricAlgorithm symmetricAlgorithm = this.CreateSymmetricAlgorithm(this.algorithm.Text); 2. Create or retrieve key. symmetricAlgorithm.Key = Convert.FromBase64String(this.key.Text); 3. Generate the IV. symmetricAlgorithm.IV = Convert.FromBase64String(this.initializationVector.Text); 4. Convert the clear text data to an array of bytes. 5. Encrypt the clear text byte array. ICryptoTransform encryptor = symmetricAlgorithm.CreateEncryptor(symmetricAlgorithm.Key, symmetricAlgorithm.IV); // Create the streams used for encryption. MemoryStream memoryStream = new MemoryStream(); using (CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write)) { byte[] plainTextAsBytes = new UTF8Encoding(false).GetBytes(this.plainText.Text); cryptoStream.Write(plainTextAsBytes, 0, plainTextAsBytes.Length); } symmetricAlgorithm.Clear(); byte[] encryptedData = memoryStream.ToArray(); 6. Store the encryption data and the IV. this.encryptedValue.Text = Convert.ToBase64String(encryptedData); 7. If the key is new store it.

Encryption with Generated Keys. Decryption: 1. Choose the same algorithm that was used to encrypt the data. SymmetricAlgorithm symmetricAlgorithm = this.CreateSymmetricAlgorithm(this.algorithm.Text); 2. Retrieve the key that was used. symmetricAlgorithm.Key = Convert.FromBase64String(this.key.Text); 3. Retrieve the IV that was used. symmetricAlgorithm.IV = Convert.FromBase64String(this.initializationVector.Text); 4. Retrieve the encrypted data. 5. Decrypt the data. ICryptoTransform decryptor = symmetricAlgorithm.CreateDecryptor(symmetricAlgorithm.Key, symmetricAlgorithm.IV); // Create the streams used for encryption. MemoryStream memoryStream = new MemoryStream(); using (CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Write)) { byte[] encryptedBytes = Convert.FromBase64String(this.encryptedValue.Text); cryptoStream.Write(encryptedBytes, 0, encryptedBytes.Length); } symmetricAlgorithm.Clear(); 6. Convert the data back to its original form. this.plainText.Text = new UTF8Encoding(false).GetString(memoryStream.ToArray());