Alyce Alyce Oct 14, 2006 - "Reverted to Oct 9, 2006 7:07 am: restoring submission instructions"

Submit Articles Here for Liberty BASIC Programmer's Encyclopedia

Cryptography Liberty BASIC Programmer's Encyclopedia

Anybody can submit articles to the Liberty BASIC Programmer's Encyclopedia. You do not need to be a member of Wikispaces or of this site.

License
By adding content to the Liberty BASIC Programmer's Encyclopedia, you are bound by the license. If you do not want to release your work under this license, do not submit articles. Click HERE to read the License.

Article Guidelines
The Liberty BASIC Programmer's Encyclopedia is a place for full-length technical articles. Authors should make sure that articles are well-structured, that words are spelled correctly, and that all code works properly. Click HERE for help on technical writing.

Adding Articles
  1. Click the edit button at the top of this page.
  2. Add your article to the list at the bottom of this page by typing a name for your page inside of double square brackets. If your article is called "Using Arrays", your link would look like this: * [[Using Arrays]]
  3. Save the editing of this page.
  4. View this page and click on the link you just created.
  5. On the new page, click the edit link and type or paste your article.
  6. Please place your name and the date at the top of your article, along with a descriptive title.
  7. Save your edits. That's all there is to it!

Editing Articles
To learn how to use WikiText markup to edit site content, click HERE. You don't need to know WikiText, though. When you are editing a page, there is a button near the bottom to "Use Visual Editor." If you want to try some editing in a safe place where you can do no harm, play in the Test Area . Before finalizing the article, you can click the "Preview" button to see how your article will appear, and make changes as needed.

Additional Files
If your article requires images or other additional files, simply upload them and include links in your article. When you are editing a page there is a link in the upper right for "Images". Click this to view a list of all available files and images.

Article Placement
One of the organizers of the Liberty Basic 102: Classical Cryptography: DES By Onur Alver (CryptoMan) INTRODUCTION We BASIC Programmer's Encyclopedia will continue tag your article for editing. If the organizers find it to be a viable article for the encyclopedia, it will be added to the all appropriate categories.

Confirmation
Organizers of the Liberty BASIC Programmer's Encyclopedia will make any modifications they feel are needed. Authors may accept or reject these changes before articles are listed in our series of articles about Cryptography from where we left of at our first article. We have talked about the basics of cryptography and historical cryptography which has still some influences today. You can see those simple and seemingly complex ideas is finding their way into various articles, code snippets or sample code as ‘good’ or ‘sufficient’ cryptography. Unfortunately, those things are only good entertainment but not really cryptography. So, let’s continue our study of cryptography and understand what is good cryptography. In our first article we have focused on substitution technique. Remember that substitution technique is a system where the letters of plaintext (unciphered data) replaced by other letters or numbers or symbols. This is like substituting X for A, K for B, etc. or XORing plaintext with another character which is effectively moving the alphabet by as many characters of the ASCII value of the character it is XOR’ed with. Now, let’s continue with transposition . TRANSPOSITION Transposition is changing the position of letters the appropriate categories and locked.

Article Modification in a predetermined way. For example you can divide the text into two halves by taking every other character as shown below: PLAINTEXT : ATTACKENEMYONAUGUST22AT 330GMT --> LEFT : ATCEEYNUUT2T30M ---> --> RIGHT: TAKNMOAGS2A03GT ---> TRANSPOSED :ATCEEYNUUT2T30MTAKNMOAGS2A03GT Ofcourse, you can invent more complex division schemes than the simple example given above and what you usually do after transposition is pass the resultant transposed text from a number of substitution functions which will translate characters into other characters in a predetermined schedule. On the following example in Liberty Basic we will first use the above simple transposition followed by a polyalphabetic substitution. REM TRANSPOSITION + SUBSTITUTION EXAMPLE REM FIRST TRANSPOSED THEN POLYALPHABETICALLY SUBSTITUTED REM AND EVERYTHING DONE IN REVERSE TO OBTAIN ORIGINAL MESSAGE. POLYDEPTH=5:DIM CRYPTKEY$(POLYDEPTH) PLAINKEY$= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ:. " CRYPTKEY$(1)="LNOP4KQ6RSTFVEWZ:M.01X2H3G5A789BY CUDIJ" CRYPTKEY$(2)="4KQ6RSTFVEWL7IJ89BYCU DNOPZ:M.01X2H3G5A" CRYPTKEY$(3)="59B YCUDIJLA78NOP4KQ6RSTFVEWZ:M.01X2H3G" CRYPTKEY$(4)="VEWZ:M.01X2H3LNOP4KQ6RSTFG5A789BY CUDIJ" CRYPTKEY$(5)="4KQL7IJ89BYCU DNO6RSTFVEWPZ:M.01X2H3G5A" PLAINTEXT$="ATTACK AT 23:45 25 JUNE 2001" TRANSPOSEDTEXT$="" LEFTSIDE$="" RIGHTSIDE$="" FOR I=1 TO INT(LEN(PLAINTEXT$)) STEP 2 LEFTSIDE$ =LEFTSIDE$+MID$(PLAINTEXT$,I,1) RIGHTSIDE$=RIGHTSIDE$+MID$(PLAINTEXT$,I+1,1) NEXT I TRANSPOSEDTEXT$=LEFTSIDE$+RIGHTSIDE$ CIPHERTEXT$="" FOR I=1 TO LEN(TRANSPOSEDTEXT$) FOR J=1 TO LEN(PLAINKEY$) CurrentChar$=UPPER$(MID$(TRANSPOSEDTEXT$,I,1)) CurrentPos$ =MID$(PLAINKEY$,J,1) IF CurrentChar$=CurrentPos$ THEN CIPHERTEXT$ = CIPHERTEXT$ + MID$( CRYPTKEY$( (I MOD POLYDEPTH)+1), J, 1) EXIT FOR END IF NEXT J NEXT I DECIPHEREDTEXT$="" FOR I=1 TO LEN(CIPHERTEXT$) FOR J=1 TO LEN(CRYPTKEY$(1)) CurrentChar$=UPPER$(MID$(CIPHERTEXT$,I,1)) CurrentPos$ =MID$(CRYPTKEY$( (I MOD POLYDEPTH)+1),J,1) IF CurrentChar$=CurrentPos$ THEN DECIPHEREDTEXT$ = DECIPHEREDTEXT$ + MID$( PLAINKEY$, J, 1) EXIT FOR END IF NEXT J NEXT I ‘AT THIS STAGE WHAT IS DECIPHERED IS TRANSPOSED TEXT ‘TO FIND CLEARTEXT WE MUST UN-TRANSPOSE IT SKIP=INT(LEN(PLAINTEXT$)/2) CLR$="" FOR I=1 TO SKIP CLR$=CLR$+MID$(DECIPHEREDTEXT$,I,1)+MID$(DECIPHEREDTEXT$,SKIP+I,1) NEXT I PRINT "PLAIN TEXT :";PLAINTEXT$ PRINT "TRANSPOSED TEXT:";TRANSPOSEDTEXT$ PRINT "CIPHER TEXT :";CIPHERTEXT$ PRINT "DECIPHERED :";CLR$ The result of the execution of this code is: PLAIN TEXT :ATTACK AT 23:45 25 JUNE 2001 TRANSPOSED TEXT:ATC T2:52 UE20TAKA 34 5JN 01 CIPHER TEXT :W:3A8QHMQJ0NW48W62APRGMSHA5E DECIPHERED :ATTACK AT 23:45 25 JUNE 2001 So, you must be getting the idea by now. By creating more complex transposition and substitution formulas you can build very good crypto systems. The key idea the Future
One of the advantages of this format is that your formula and design must it affords us the ability to update and modify the information. Organizers reserve the right to modify, expand, or delete articles as they determine such actions to be public so everyone can build the necessary software according to your algorithm, test, analyze and critize it for possible weaknesses and suggest improvements. What must be secret is the KEY to your encryption. ENCRYPTION KEY As a good physical key, an encryption key should be unique and should only open a specific lock or in our case decrypt the cipher text. This software equivalent of a physical key is a string of bits, say 64 bits. This to say a chain of ones and zeroes like this: 1100011110010110000010111110000100001111111100110000010101101110 And you can visualize ones as the teeth and zeroes as the rod of the key. These ones and zeroes will instruct into our algorithm how we want to transpose and substitute each bit on our data instead of making a simple schedule of take every other character apart. What you do instead, you take a block of data, usually 8 bytes, convert it into 64 bits and according to a complex schedule as instructed appropriate.


LIST ARTICLES HERE