### - Javascript Encryption series: webpages to encrypt things from your little brother or sister.
Browser's Javascript:
◆   Step 64© Text Encryption  Step64 Text Encryption  
      Step 64© 文本加密
 by JCPMA
Text Window

        
Results Window

Step64 text encryption

 
Encryption key:
            
      Encryption options:
Use exact key -- Default is checked; (Unchecking manipulates key with 82 character seed) --
Triple encryption -- Default is checked; (When checked, this runs encryption 2 additional times, with the middle pass using a reverse cipher-key) --
Step64 Text Encryption   ◆   Step 64 Text Encryption   What is this?
   This panel enables encrypting text messages of either regular latin text characters, or unicode characters which may include unusual letters, symbols or punctuation.

 INSTRUCTIONS
1) Enter your message/unicode text in the top window, "Text Window".
2) Hit the "Encode" button.
 (This converts contemporary text into Base 64 code, a traditional text.)
3) Enter a key (password), and click the "Encrypt" button.
 (This encrypts text into Cipher Text.)

1] To decrypt the message you would do the above in reverse order. Paste cipher text into the 2nd window, the "Results Window".
2] Enter the key (password), and click the "Decrypt" button.
3] Click on the "Decode" button.
 (This gives the original plain text.)

The "Select" button higlights text in the "Results Window".

HINTS - What the results look like:
Base64 code is mostly letters and numbers with the occasional plus sign "+", equal sign "=", and forward slash "/".
5wrLCs8KnwqvCu+KAueKAus/DkcOxw5bDtsOUw7TDnMO8xbjDv8W9i88Pj9cfFtde30=

The Cipher Text has more keyboard symbols and punctuation!
S5!<G~#LF=W|r9@/S$-E#"^s~",Us^)!GD-#LJ="WP2qFq^@+M5/<V43*#&oA#


DISCUSSION
Why encrypt using a two step process?
This a hybrid of two main javascript components. The base 64 converter at best is a VERY WEAK encryptor. It has no password protection, but its strength lies in its versatility, its ability to handle UNICODE characters and different languages. The resulting base 64 text uses only conventional characters and thus is COMPATIBLE with most text applications. The encoded text RETAINS THE MESSAGE'S FORMATTING and line/carriage returns!
The text encryptor offers PASSWORD PROTECTION and can handle regular text and standard punctuation and symbols. If you plan to encrypt regular standard text, then you do not have to use the base 64 function. You can directly enter your message into the "Results Window", (the 2nd window), and proceed to encrypt the message. Non-standard characters, even slightly fancier text symbols will render the encryptor component inaccurate or unusable. By default the text runs through three encryption passes. (You have the option though to run it through only one pass by unchecking the box.) However it is still considered a WEAK encryption application. But, ... by combining the overall process with the base 64 converter, a two step process, can increase the encryption quality to a MEDIUM STRENGTH!
The full version of the original Step 64 webpage (UTF-8 encoded), is UNDER 20 KB*, runs on javascript and should work ANYWHERE. When saved locally it should run even if there is no internet connection. (* The unicode (aka "Unicode BOM") encoded variant is almost twice the size at 37 KB.)



A Note on Using Different Web Browsers
   This page was tested with three browsers and it was found the resulting BASE 64 TEXT differed between them. Apparently web browsers treat line returns (aka carriage returns) uniquely. These three browsers, Internet Explorer, Firefox, and Google Chrome give an identical base64 code for one line of text:
myfavoritecereal
- code is bXlmYXZvcml0ZWNlcmVhbA==
However for text with a line return, the code is slightly different. Example:
myfavoritecereal
comesinacardboardbox
- code is bXlmYXZvcml0ZWNlcmVhbA0KY29tZXNpbmFjYXJkYm9hcmRib3g=   for Internet Explorer
- code is bXlmYXZvcml0ZWNlcmVhbApjb21lc2luYWNhcmRib2FyZGJveA==   for Firefox
- code is bXlmYXZvcml0ZWNlcmVhbApjb21lc2luYWNhcmRib2FyZGJveA==   for Google Chrome
There is some reassurance though, as decoding "browser A's" code using the other brand of web browser, "browser B" still gives you the correct original text! (i.e., encoding with Firefox and then using InternetExplorer to decode the message.)
   Similarly I was reassured after I cross-tested the different resulting CIPHER TEXT in the three browsers. The two step decryption was successful in that the original message was retained in all three browsers!

Credits
The base 64 portion of the script was modified from the "base64" appendix directory in Lingoes© portable version 2.762  (http://www.lingoes.net).
The text encryptor portion of the javascript was modified from Randy Welfley's © JScramble© webpage at http://randy.welfley.us/jscram.htm
The browser javascript indicator is of script written by John Walker ©  http://www.fourmilab.ch
Step 64© was created by JCPMA © Copyright November 2011
The Copyright © holders have all rights reserved. The software and web documents are provided "as is" without express or implied warranty of any kind by the parties and contributors involved.