You are invited to Log in or Register a free Frihost Account!

Code Cipher Combination

Please rate this thread on a scale of 01 to 10.
 100%  [ 1 ]
 0%  [ 0 ]
 0%  [ 0 ]
 0%  [ 0 ]
 0%  [ 0 ]
 0%  [ 0 ]
 0%  [ 0 ]
 0%  [ 0 ]
 0%  [ 0 ]
Total Votes : 1

I have been studying cryptography and cryptanalysis for over two years at present and I have been working on the strongest cryptographic tool ever devised.

Now, the next four paragraphs are for people new to the above mentioned subjects, so if you know about it you may omit it.

Cryptography is the process of hiding information by converting it into unintelligible gibberish by means of two algorithms in which similar instances are called keys. It has two branches: Codes and Ciphers.

In a code a unit of information (e.g. word, phrase, sentence, etc.) is converted to something else. Codes are outdated because to encode some information you need a codebook, and making a codebook is very very time-consuming as there are many many words, phrases and sentences. Though Codes are very strong, making one is unpractical.

In a Cipher each alphabet used in the piece of information is converted to something else. So the 26 characters in English each have thier own respective characters. The strength of the cipher is the number of permutations in the arrangement of its characters. So in the Caesar's Shift Cipher (in which there are 26 characters arranged definite order, the number of permutations or the strength of the cipher is 26). If the 26 characters were to be arranged in any order then the strength would be 26 into 26 or 676.

Cryptanalysis is the method of knowing the secret information in an encrypted message without having access to the twin algorithms used to encrypt and decrypt it. It makes use of frequency analysis (a technique in which the frequency of characters in an enciphered text is matched with the normal frequency of that letter in the particular language, thus revealing the true identity of the cipher character) and other such methods. Since this is beyond the scope of this thread I will not elaborate any furthur.
A Code has a very high strength but is an unpractical means of encryption. A Cipher has a somewhat lower strength than a Code depending on its type and the language from which it is converted, but it is relatively easy to create and use. I was searching for a third form of encryption which would combine the advantages of both Codes and Ciphers and yet retain characteristics of its own and I have discovered such a new method of encryption after much contemplation and mental debate. However, I would take credit for this discovery until I am sure that no one else has discovered it before me. If you know that someone else has patented my discovery, please inform me with the necessary evidence.

I first thought of this method when I was considering number systems in general. The decimal number system has 10 characters. The binary number system has 2. When we convert a decimal number into a binary number, the length of the number increases but it still retains its value as a number. For example 2 apples in decimal mean 2 apples, but 10 apples in binary also mean 2 apples.

This made me think further and I considered using more than 10 characters. By doing so the length of the number would significantly decrease. Next, I thought of the hexadecimal number system. It had both numbers and alphabets. So I realised that it was possible to convert numbers into alphabets and vice versa. In addition, on converting the alphabets into the decimal system you could further convert it into a hexadecimal number or even base 32 or base 64 numbers. Thus the length of a sentence could be significantly decreased and encrypted at the same time.

The advantage that one gains in such a bargain is that this new form of encryption is immune to conventional methods of cryptanalysis like frequency analysis. In addition, this new form of encryption will not reveal its secret until the whole message is considered as one whole unit of encryption. This gives the cryptographer an edge as a cryptanalyst with no knowledge of such a form of encryption would be baffled by it. Another advantage is that the cryptanalyst does not know how many symbols were used in the encryption or the base. Of course one can count the number of symbols in a message but upon using a very high base it is highly unlikely that all of them would be revealed. If we use all the characters in the Unicode (which is over 100,100) it would be almost impossible to break it. Even if he does know the characters used, he will not be able to find their corresponding numbers in the decimal number system. We can furthermore encipher the encrypted text to produce an even more baffling encryption.

The use of this new form however has its disadvantages. First, to encrypt the information a lot of mathematical calculation is required. Doing such calculation on paper is not practical so computers must be used. Secondly, when we convert English (base 27 – I have included space as the first character as 0 does not have a value and so if it is at the beginning of a unit of encryption, significant characters do not get deleted – e.g. ‘art’ is converted into a number and on conversion back into English it turns out to be ‘rt’ as ‘a’ being 0 does not have a value) into decimal the calculations are small up to a certain extent; then they become too large and the computer produces wrong results. So using even high bases is out of the question for ordinary computers the calculations become too large. Nonetheless, I believe that it can be possible with supercomputers used in governments etc.

I will soon be posting the source of an HTML document that shows a practical demonstration of this new form of encryption. If you have any suggestions or queries please post them to me.
Create a new web page on your local host and save the source of the following HTML code in it. Then run it for a practical demonstration of the new form of encryption I discovered.

Note: Follow the onscreen instructions. You can type in directly onto the screen.

      <title>Basal Cipher</title>
      <style type="text/css">
            font:13px Courier New;
      <script type="text/javascript">
         var bckey=new Array(" ","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");
         var base32=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v");
         function toBase32(decimal)
            var base32_reversed="";
               var facevalue=decimal%base32.length;
            var Base32="";
            for(var i=base32_reversed.length-1;i>=0;i--)Base32+=base32_reversed.charAt(i);
            return Base32;
         function toDecimal(Base32)
            var decimal=0;
            for(var i=0;i<Base32.length;i++)
               var facevalue=base32.indexOf(Base32.charAt(i));
               var placevalue=facevalue*Math.pow(base32.length,Base32.length-i-1);
            return decimal;
         function encipher(plaintext)
            var ciphertext=0;
            for(var i=0;i<plaintext.length;i++)
               var facevalue=bckey.indexOf(plaintext.charAt(i));
               var placevalue=facevalue*Math.pow(bckey.length,plaintext.length-i-1);
            return toBase32(ciphertext);
         function decipher(ciphertext)
            var plaintext_reversed="";
               var facevalue=ciphertext%bckey.length;
            var plaintext="";
            for(var i=plaintext_reversed.length-1;i>=0;i--)plaintext+=plaintext_reversed.charAt(i);
            return plaintext;
         function encipher_algorithm(alphabet_string)
            alphabet_string=alphabet_string.split(" ");
            var number_string="";
            for(var i=0;i<alphabet_string.length;i++)
               var element=alphabet_string[i];
               var modified_element="";
               number_string+=modified_element+" ";
            return number_string;
         function decipher_algorithm(number_string)
            number_string=number_string.split(" ");
            var alphabet_string="";
            for(var i=0;i<number_string.length;i++)
               var element=number_string[i].split(";");
               var modified_element="";
               for(var j=0;j<element.length;j++)
               alphabet_string+=modified_element+" ";
            return alphabet_string;
         var message;
         var message_index;
         function type_char()
         function print_message(string)
            print_message("Press Enter to initialize the Basal Cipher Translator.");
         var initialize=true;
         var input_plaintext="";
         var cipher_mode=false;
         var input_ciphertext="";
         var decipher_mode=false;
            var keyCode=e.keyCode;
               print_message("Press Enter to type in a message and press Enter again to encipher it. Press Spacebar to type in a ciphered message and press Enter to decipher it.");
                  else if(keyCode==32)input_plaintext+=" ";
                  else if(keyCode==8&&input_plaintext.length>0)input_plaintext=input_plaintext.substring(0,input_plaintext.length-1);
                  else if(keyCode==13)
                     print_message("The input message translates as: "+encipher_algorithm(input_plaintext));
               else if(decipher_mode)
                  else if(keyCode==59)input_ciphertext+=";";
                  else if(keyCode==32)input_ciphertext+=" ";
                  else if(keyCode==8&&input_ciphertext.length>0)input_ciphertext=input_ciphertext.substring(0,input_ciphertext.length-1);
                  else if(keyCode==13)
                     print_message("The input ciphered message translates as: "+decipher_algorithm(input_ciphertext));
               else if(keyCode==13)
                  print_message("Type in a message and press Enter to encipher it:");
               else if(keyCode==32&&!initialize)
                  print_message("Type in a ciphered message and press Enter to decipher it:");
      <div id="message_box"></div>
      <div id="input_box"></div>
the above code doesnt work at all in FireFox 3.0.10 and IE 6 (dont know about other versions).

It works in Opera 9.26 but creates lots of problems, and even ignoring the problems, in the end it doesnt provide encyphered string.
Agent ME
This has been done before, and is of little use for encryption. See Base64 (and a simple demonstration page here).

It isn't very useful actual encryption because it is fairly simple to crack such an encoding scheme if you have the slightest idea of what the encoded data is. The main use for Base64 is to convert "binary" data (not binary as in base 2, but rather series of bytes that don't map to printable ASCII characters) into printable code in order to be transferred through mediums that require printable ASCII.

Also, your understanding of cryptography is a bit outdated. Such ciphers you described map plain text characters one-to-one with with cipher chars, which is very weak. Imagine if you encoded a the text "The fox hides in the foxhole" to "Gur sbk uvqrf va gur sbkubyr" (this is using ROT13, where every letter is changed to the letter 13 places away on the alphabet). The phrase "gur" appears twice, and if one looks at a list of common three letter words, "the" is a pretty obvious candidate, and the encoding method can be derived from that.
Some other ciphers such as the Vigenère cipher try to fix this by having different letters map to different cipher characters depending on position, but this is also easily breakable with longer ciphertexts.

That is about as advanced as cryptography was a hundred or more years ago. In the past few decades, things have gotten really interesting with computers.

With modern ciphers, the plaintext is encrypted by a key which is kept secret. The cipher itself can be known by everyone, but no one can decode the cipher text without the secret key (assuming the cipher is good). This is also known as symmetric key cryptography, where the same key is used to encrypt and decrypt the data.

There is also "public key cryptography", where the plaintext is encrypted by a person's public key. People can encrypt messages using a freely-known public key, but not decrypt them. Every public key has a corresponding private key, which is needed to actually decrypt the messages.
This allows anyone to send an encrypted message to any receiver using their public key, and know that only the intended receiver with the private key can read the message.
This system is used on the internet commonly - whenever you go to a website with the "https" protocol, the connection is encrypted with public key cryptography.

There are also other advanced concepts to modern cryptography including digital signatures and hashing functions that you might also want to look at.

There isn't much room for improvement to cryptography.
This thread sounds like hard work to me. There is so much encryption software available on the Web. The following encryption software is simple to use and free (it also comes with tutorials):
I'd recommend you start reading all the wiki pages on existing encryption algorithms and define what you want to create a bit more. Also don't think you can create "the strongest cryptographic tool ever devised" on your own with only 2 years experience. You need to be a good mathematician with a good amount of knowledge on cryptography to even be able to reproduce the latest encryption algorithms.

moved to Basics

This move is part of rvec's big general chat cleanup
Gael_Knightley wrote:
If the 26 characters were to be arranged in any order then the strength would be 26 into 26 or 676.

Sorry, don't know anything about cryptography. But surely if the 26 characters were to be arranged in any order then the strength would be 26! = 26x25x24x...x1, and not 26^2=676 as you stated.
Related topics
De da vinci code
add some media code in the forum
How Spyware Works!!!
PHP: Directory listing code
Problam about google ad code
One Liners for Code Cowboys
DJ turntable out of an old mouse
Show PHP Code
Warcraft III - Frozen Throne ( Cheat code )
Security Code Graphic
very simple PHP code to get search query string
Programming Help & Support Guidelines
How to realize "BB-Code"
Reply to topic    Frihost Forum Index -> Science -> Basics

© 2005-2011 Frihost, forums powered by phpBB.