1 / 8

Encryption Theory

Encryption Theory. CSC380 – Flint Joasaint, Marcial White. The Algorithm. RPG Program CCED01. Originally intended for 16 digit keys, We’ve extended it to 24 digits (A-Z). abcdefghijklmnopqrstuvwxyz bcdefghijklmnopqrstuvwxyza cdefghijklmnopqrstuvwxyzab defghijklmnopqrstuvwxyzabc

keith
Download Presentation

Encryption Theory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Encryption Theory CSC380 – Flint Joasaint, Marcial White

  2. The Algorithm RPG Program CCED01 Originally intended for 16 digit keys, We’ve extended it to 24 digits (A-Z) abcdefghijklmnopqrstuvwxyz bcdefghijklmnopqrstuvwxyza cdefghijklmnopqrstuvwxyzab defghijklmnopqrstuvwxyzabc efghijklmnopqrstuvwxyzabcd fghijklmnopqrstuvwxyzabcde ghijklmnopqrstuvwxyzabcdef hijklmnopqrstuvwxyzabcdefg ijklmnopqrstuvwxyzabcdefgh jklmnopqrstuvwxyzabcdefghi klmnopqrstuvwxyzabcdefghij lmnopqrstuvwxyzabcdefghijk mnopqrstuvwxyzabcdefghijkl nopqrstuvwxyzabcdefghijklm opqrstuvwxyzabcdefghijklmn pqrstuvwxyzabcdefghijklmno qrstuvwxyzabcdefghijklmnop rstuvwxyzabcdefghijklmnopq stuvwxyzabcdefghijklmnopqr tuvwxyzabcdefghijklmnopqrs uvwxyzabcdefghijklmnopqrst vwxyzabcdefghijklmnopqrstu Etc…

  3. Algorithm Continued … Program CCED01 has only one parameter: a 25-byte character value. The first 24 bytes contain a left-justified letter. The last byte must contain E to encrypt or D to decrypt. CALL PGM (CCED01) PARM (‘Hello World E') Will yield “HDJKK QHJCT” CALL PGM (CCED01) PARM (‘HDJKK QHJCT D') Will decrypt the message.

  4. Algorithm Continued For decryption … Input Letter H D J K K Q H J C T Array Element abcdefghijklmnopqrstuvwxyz bcdefghijklmnopqrstuvwxyza cdefghijklmnopqrstuvwxyzab defghijklmnopqrstuvwxyzabc efghijklmnopqrstuvwxyzabcd fghijklmnopqrstuvwxyzabcde ghijklmnopqrstuvwxyzabcdef hijklmnopqrstuvwxyzabcdefg ijklmnopqrstuvwxyzabcdefgh jklmnopqrstuvwxyzabcdefghi klmnopqrstuvwxyzabcdefghij Output Letter H E L L O W O R L D

  5. The Interface

  6. The Code public class simple{// Might randomize placement of characters in array laterstring[] characters = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};string[] cypertext = {"!","@","#","$","%",">","&","*","(",")","!","@","#","$","%",">","&","*","(",")","&","*","(",")"};public simpleencrypt(){}public string EncryptString(string Data, string Key){if(Data.Length == 0)throw new ArgumentException("Hey Your key must be at please 1 digit.");uint[] formattedKey = FormatKey(Key);if(Data.Length%2!=0) Data += '\0'; byte[] dataBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(Data);string changedtext = string.Empty;uint[] tempData = new uint[2];for(int i=0; i

  7. The Code, Cont… public class simple{// Might randomize placement of characters in array laterstring[] characters = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};string[] cypertext = {"!","@","#","$","%",">","&","*","(",")","!","@","#","$","%",">","&","*","(",")","&","*","(",")"};public simpleencrypt(){} public string EncryptString(string Data, string Key){if(Data.Length == 0)throw new ArgumentException("Hey Your key must be at please 1 digit.");uint[] formattedKey = FormatKey(Key);

  8. Code cont … if(Data.Length%2!=0) Data += '\0'; byte[] dataBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(Data);string changedtext = string.Empty;uint[] tempData = new uint[2]; for( int ix = 0; ix < data.Count; ++ix ){str = ( string )data[ ix ];sentences[ ix ] = str.Split( char );}changedtext += Util.ConvertUIntToString(tempData[0]) + Util.ConvertUIntToString(tempData[1]);}return changedtext;}

More Related