Cryptography Classic Data Encryption 43 Views 0 0 RELATED TITLES Cryptography
Total Page:16
File Type:pdf, Size:1020Kb
43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By Cryptography Classic Data Encryption 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By Content Content Page Basic Terminology 33 Introduction 4 Symmetric Cipher 55 Caesar Cipher 77 Base 64 encoding 88 Monoalphabetic Cipher 99 Playfair Cipher 13 Hill Cipher 15 Vigenère Cipher 17 Rail Fence Cipher 18 Row Transposition Cipher 18 Product Cipher 19 Base 64 Encoding Table 20 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By Basic terminology Plaintext = original message to be encrypted Ciphertext = the encrypted message Enciphering or encryption = the process of converting plaintext into ciphertext Encryption algorithm = The sequence of data processing steps that go into transforming plaintext into ciphertext. - two inputs: a plaintext, secret key Deciphering or decryption = recovering plaintext from ciphertext Decryption algorithm = The sequence of data processing steps that into transforming ciphertext back into plaintext. - two inputs: a ciphertext, secret key Secret key = same key used for encryption and decryption - Also referred as a symmetric key Cryptography = the many schemes available today for encryption and decryption Cryptography system = any single scheme for encryption and decryption Cipher = a cipher means the same thing as a “cryptographic system” Block cipher = a block cipher processes a block of input data at a time and produces a ciphertext block of the same size Stream cipher = a stream cipher encrypts data on the usually one byte at a time Cryptanalysis = means “breaking the code” Brute – force attack = means trying every possible key on a of ciphertext until an intelligible translation into plaintext is obtained Key space = the total number of all possible keys that can be used in a cryptographic system 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By Introduction Encryption is the conversion of data into a form, called a ciphertext, that cannot be easily understood by unauthorized people. Decryption is the process of converting encrypted data back into its original form, so it can be understood. The use of encryption/decryption is as old as the art of communication. In wartime, a cipher, often incorrectly called a code, can be employed to keep the enemy from obtaining the contents of transmissions. (Technically, a code is a means of representing a signal without the intent of keeping it secret; examples are Morse code and ASCII.) Simple ciphers include the substitution of letters for numbers, the rotation of letters in the alphabet, and the "scrambling" of voice signals by inverting the sideband frequencies. More complex ciphers work according to sophisticated computer algorithms that rearrange the data bits in digital signals. In order to easily recover the contents of an encrypted signal, the correct decryption key is required. The key is an algorithm that undoes the work of the encryption algorithm. Alternatively, a computer can be used in an attempt to break the cipher. The more complex the encryption algorithm, the more difficult it becomes to eavesdrop on the communications without access to the key. Here I would like to introduce some of the classic encryption: 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By Symmetric Cipher A symmetric cipher model Example (symmetric-key encryption) Let A = {A,B,C,…..,X,Y,Z} be the English Alphabet Let m and c to be the set of all strings (words) of length five over A. To encrypt, an English message is broken up into groups each having five letters (with appropriate padding if the length of the message is not a multiple of five) A permutation(change) e is applied to each letter one at a time. To decrypt, the inverse permutation d = e-1 is applied to each letter of ciphertext. For instance, supposed that the key e is chosen to be the permutation which maps each letter to the one which is three position to its right, as shown: ( ) A message plain text = THIS CIPHER IS CERTAINLY NO SECURE. m = THISC IPHER ISCER TAINL YNOTS ECURE group it into five is encrypted to c = Ee = WKLVF LSKHU LVFHU WDLQO BQRWV HFXUH Ciphertext = wklvflskhulvfhuwdlqobqrwvhfxuh Explanation: c = ciphertext E = encryption algorithm d = decryption algorithm 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By - Two requirements for secure use of symmetric encryption: a. a strong encryption algorithm b. a secret key known only to sender / receiver c = Ek (m) m = Dk (c) - Implies a secure channel to distribute key - Cryptography can characterize by: a. type of encryption operations used - substitution / transposition / product b. number of keys used - single – key or private / two – key or public c. way in which plaintext is processed - block / stream • Mathematically: Y = EK( X) or Y = E(K, X) X = DK(Y ) or X = D(K, Y ) • X = plaintext • Y = ciphertext • K = secret key • E = encryption algorithm • D = decryption algorithm • Both E and D are known to public Substitution Ciphers - Replacing each element of the plaintext with another element Shift ciphers Base64 encoding Monoalphabetic ciphers 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By Shift Ciphers : Caesar cipher - This is the earlier known example of a substitution cipher. - invented by Julius Caesar - First attested use in military affairs - Replacing each letter of the plaintext by a shifted letter in the alphabet used. - If the shift value is (3) then we can define transformation as: - e.g : plaintext : meet me after toga party ciphertext : PHHW PH DIWHU WKH WRJD SDUWB - If we represent each letter of the alphabet by an integer that corresponds to its position in the alphabet, such as: a, b, c, ..., x, y, z 0, 1, 2, ..., 23, 24, 25 The formula for placing each character p of the plaintext with a character c of the ciphertext can be expressed as: WhereE()stands for encryption. The operator returns the integer remainder of the division when is divided by 26, the number of letters in the English alphabet assuming case-insensitive - A more general version of this cipher that allows for any degree of shift would be expressed by 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By base64 encoding - A simple substitution cipher obviously looks much too simple to be able to provide any security, but that is the case only if you have some idea regarding the nature of plaintext - For example, in the plaintext “Man” , encoded in ASCII the character M, a and n are stored as bytes 77, 97 and 110 which are the 8-bit binary values 01001101, 01100001 and 01101110. These three values are joined together into a 24-bit string, producing 010011010110000101101110. Group of 6-bits (6 bits have a maximum of 26 = 64 different binary values) are converted into individual numbers from left to right (in this case, there are four numbers in a 24-bit string), which are then converted into their corresponding Base64 character values. Text content M a n ASCII 77 (0x4d) 97 (0x61) 110 (0x6e) Bit pattern 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 1 0 1 1 0 1 1 1 0 Index 19 22 5 46 Base64-encoded T W F u - The table of this encoding will be shown at the Base 64 Encoding Table section. 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By monoalphabetic ciphers - Basically, Caesar cipher is also a kind of monoalphabetic ciphers. In monoalphabetic ciphers, we have a substitution rule that gives us a replaceme ciphertext letter for each letter of the alphabet used in the plaintext message. - Let‟s now consider a seemingly strong monoalphabetic cipher by making our substitution letters a random permutation of the 26 letters of the alphabet: - The encryption key is now the sequence of substitution letters. In other words, the key in this case is the actual random permutation of the alphabet used. - Since there are 26! permutations of the alphabet, we end up with an extremely large key space. The number 26! is much larger than 4 x 10 26. Since each permutation constitutes a key, that means that the monoalphabetic cipher has a key space of size more than 4 x 1026. - With this extremely large key space, you might think that it is secure. You are WRONG. There is language characteristic problems. 43 views 0 0 RELATED TITLES Cryptography Uploaded by ooijunyu Simple cryptography for fun! Full description Save Embed Share Print Summary UQ SCIE1000 Military Crypt 14 Analysis By Language Statistic and Cryptanalysis on Monoalphabetic ciphers - A very large key space of a monoalphabetic cipher means that the total number of all possible keys that would need to be guessed in a pure brute-force attack would be much too large for such an attack to feasible.