How To Make Your Own Encryption

davisde
****UPDATE: DOWNLOAD THE PROJECT FILES****

This video lays out the steps for creating a very simple encryption and decryption program using free tools. The programming language we will be using is VB Script.  See if you can decrypt this text:

wkjlue#vnrro#huxwxi#uxr\


The code below is for the encrypting program:

<—–Start copying below this line—–>
‘SIMPLE VB ENCRYPTION PROGRAM
‘Create a dialogue box that asks for the text to encode
set x = WScript.CreateObject(“WScript.Shell”)
mySecret = inputbox(“Enter text to be encoded”)
‘Reverse the submitted text
mySecret = StrReverse(mySecret)
‘Open up an instance of Notepad to print the results after waiting for 1 second
x.Run “%windir%\notepad”
wscript.sleep 1000
x.sendkeys encode(mySecret)’This function encodes the text by advancing each character 3 letters
function encode(s)
For i = 1 To Len(s)
newtxt = Mid(s, i, 1)
newtxt = Chr(Asc(newtxt)+3)
coded = coded & newtxt
Next
encode = coded
End Function
<—-Stop copying above this line——>
<—–Start copying below this line—–>
‘SIMPLE VB DECRYPTION PROGRAM
‘Create a dialogue box that asks for the text to encode
set x = WScript.CreateObject(“WScript.Shell”)
mySecret = inputbox(“Enter text to be encoded”)
‘Reverse the submitted text
mySecret = StrReverse(mySecret)
‘Open up an instance of Notepad to print the results after waiting for 1 second
x.Run “%windir%\notepad”
wscript.sleep 1000
x.sendkeys encode(mySecret)’This function encodes the text by advancing each character 3 letters
function encode(s)
For i = 1 To Len(s)
newtxt = Mid(s, i, 1)
newtxt = Chr(Asc(newtxt)-3)
coded = coded & newtxt
Next
encode = coded
End Function
<—-Stop copying above this line——>
<—–Start copying below this line—–>
–Applescript encryption program
set words_to_encrypt to “I want to encrypt sentences. Not just words!”
set multiplier to 5
set charList to {“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”,”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”, “1”, “2”, “3”,”4″, “5”, “6”, “7”, “8”, “9”, “0”, ” “, “~”, “!”, “@”, “#”, “$”, “%”, “^”, “&”, “*”, “(“, “)”, “_”, “+”, “{“, “}”, “|”, “:”, “\””, “<“, “>”, “?”, “`”, “-“,”=”, “[“, “]”, “\\”, “;”, “‘”, “,”, “.”, “/”, “a”}considering case
–get a list of numbers for the words corresponding to the item numbers of the characters in charList
set p_letter_list to text items of words_to_encrypt
set p_num_list to {}
repeat with i from 1 to (count of p_letter_list)
set this_letter to item i of p_letter_list
repeat with j from 1 to count of charList
set this_char to item j of charList
if this_letter is this_char then
set end of p_num_list to j
exit repeat
end if
end repeat
end repeat
–encrypt the numbers
set modulus to count of charList
set c_num_list to {}
repeat with i from 1 to (count of p_num_list)
set p_num to item i of p_num_list
set c_num to ((p_num * multiplier) mod modulus)
set end of c_num_list to c_num
end repeat
–get the characters for the encrypted numbers corresponding to the characters in charList
set c_letter_list to {}
repeat with i from 1 to (count of c_num_list)
set this_item to item i of c_num_list
set end of c_letter_list to (item this_item of charList)
end repeat
–coerce the encrypted characters into a string
set c_string to c_letter_list as string
end considering
<—-Stop copying above this line——>

64 Comments

  1. henry
    December 10, 2011 at 9:07 am

    why is this video is private !!!

  2. alokkumar
    December 10, 2011 at 2:09 pm

    It won’t let me watch the video, it says it’s private 🙁

  3. pat
    December 10, 2011 at 2:46 pm

    Thanks. This helped alot. Works Great

  4. Marco
    December 10, 2011 at 3:22 pm

    Nice. Thanks for sharing. 🙂

  5. kotesh
    December 10, 2011 at 3:37 pm

    awesome,, i just found and trying for the same thing for many days,,

    and thanks once again…

  6. susanta kumar minz
    susanta kumar minz
    December 10, 2011 at 4:22 pm

    I cannot do this……
    I followed all the steps but mine is not working………

    • matt
      April 18, 2012 at 12:15 am

      you got to put spaces at the beginning of each line

      • cant do it
        cant do it
        August 11, 2012 at 5:23 am

        diddnt work

        • cant do it
          cant do it
          August 11, 2012 at 5:30 am

          finally got it right
          decoded: Your future looks bright
          from the description

  7. WSF
    December 10, 2011 at 4:40 pm

    Hey

    i have a mac and what are i going to save the file as?

  8. eddie
    December 10, 2011 at 5:27 pm

    Hi, Interesting that it can’t handle sentences. Why is that?

    Thanks

    • Ian
      December 11, 2011 at 1:26 am

      Heres is the encrypted part fixed!

      ‘SIMPLE VB ENCRYPTION PROGRAM’
      ‘Create a dialogue box that asks for the text to encode’
      set x = WScript.CreateObject(“WScript.Shell”)
      mySecret = inputbox(“enter text to be encoded”)
      ‘Reverse the submitted text’
      mySecret = StrReverse(mySecret)
      ‘Open up an instance of Notepad to print the results after waiting for 1 second’
      x.Run “%windir%\notepad”
      wscript.sleep 1000
      x.sendkeys encode(mySecret)’this function encodes the text by advancing each character 3 letters’
      function encode(s)
      For i = 1 To Len(s)
      newtxt = Mid(s, i, 1)
      newtxt = Chr(Asc(newtxt)+3)
      coded = coded & newtxt
      Next
      encode = coded
      End Function

      • chrisjudk
        chrisjudk
        June 8, 2012 at 5:26 am

        it still wouldn’t work for me it gave me an error

    • Ian
      December 11, 2011 at 1:31 am

      And the decryption code

      ‘sIMPLE VB DECRYPTION PROGRAM’
      ‘create a dialogue box that asks for the text to encode
      set x = WScript.CreateObject(“WScript.Shell”)
      mySecret = inputbox(“Enter text to be encoded”)
      ‘Reverse the submitted text’
      mySecret = StrReverse(mySecret)
      ‘Open up an instance of Notepad to print the results after waiting for 1 second
      x.Run “%windir%\notepad”
      wscript.sleep 1000
      x.sendkeys encode(mySecret)
      ‘this function encodes the text by advancing each character 3 letters
      function encode(s)
      For i = 1 To Len(s)
      newtxt = Mid(s, i, 1)
      newtxt = Chr(Asc(newtxt)-3)
      coded = coded & newtxt
      Next
      encode = coded
      End Function

    • Ian
      December 11, 2011 at 1:42 am

      Hey
      even if you copy my code it wont work the reason it wont work is because when you copy it the ” and the ‘ are messed up idk why but they are i have included links to my files that you can use

      http://mediafire.com/?a91694bq36b3g

      it is a folder at mediafire.com just download both files and you have a encryption program!!!!

    • Daniel
      December 11, 2011 at 10:03 am

      Eddie, it’s because when you copy-paste it from here, the quote marks is wrong. You gotta delete the quote marks & make’em your self. It happens to both double & single.

    • Nathan G
      Nathan G
      December 12, 2011 at 3:39 am

      I think it’s because he left out the line for a the space bar. I’m not sure what the code for that is though sorry

    • Vineeth
      December 12, 2011 at 12:49 pm

      Hi..Eddie
      Try the same logic in vb (not vb script. it is more “STUPID SIMPLE”),if you are familiar with vb.
      With a little work and touch up you can make a good one than this one….(It can handles sentences an d new lines also. )

  9. Matthew
    December 10, 2011 at 6:36 pm

    i dont understand the apple script. could you send me it complete with a decode version without all the added stuff

  10. Ian
    December 11, 2011 at 12:37 am

    ya same a eddie wont work

  11. Ian
    December 11, 2011 at 12:54 am

    im working on fixin i found a couple problems

  12. Tyler
    December 11, 2011 at 1:17 am

    The first set of code doesnt work 🙂

  13. Ian
    December 11, 2011 at 1:44 am

    the reason why the code is not working for a lot of people is because when you copy the ” and the ‘ are messed up idk why but they are i have included links to my files that you can use. Or alternatively you can just find and replace all of those!!!!

    http://mediafire.com/?a91694bq36b3g

    it is a folder at mediafire.com just download both files and you have a encryption program!!!!

  14. parsa
    December 11, 2011 at 5:05 am

    it says invalid characters:(

  15. pablo
    December 11, 2011 at 5:22 am

    how can i decript the mac version

  16. emmet
    December 11, 2011 at 12:37 pm

    #include
    #include
    #include
    #include
    #include
    #include
    load();
    load2();
    main()
    {
    randomize();
    char message[80],ch;
    int nlenght,i;
    clrscr();
    load();
    for(;;)
    {
    printf(“Welcome to Encryption Doctor.\n”);
    printf(“\n Enter your message:”);
    gets(message);
    nlenght = strlen(message);
    for (i=0; i>>>>>>The Encrypted Message is: %s “,message);
    printf(“\n\n\n\nPress ‘1’ to Exit.”);
    printf(“\nPress ‘ENTER’ to Continue.\n”);
    ch=getch();
    if (ch==’1′)
    break; /*Program Concept From Copernicus P. Pepito’s Book ‘Introduction to Turbo C’*/
    /*Modified by:Danielle Louise S. Casoco aka. qUikSiLv3r*/
    clrscr(); /*Proudly AMA made Program*/
    }

    clrscr();
    printf(“\n\n\n\n\n\n\n\n\n\n\n\t\tProgram By:Danielle Louise S. Casoco qUiKsiLv3r”);

    return 0; /*GO!!!AMACC CALOOCAN!!*/
    }

    load()
    {
    int i;
    for(i=0;i>>\n”);
    for(x=0;x<=44;x++)
    {
    cprintf("Û");
    delay(100);
    }
    printf("\nDONE!!!!");
    return 0;
    }

  17. sam
    December 11, 2011 at 12:55 pm

    im having trouble with this on windows xp it keeps giving this error:

    line: 1
    Char: 31
    Error Invalid character
    Code: 800A0408
    Source: Microsoft VBScript compilation error

    any help??

  18. Cal
    December 11, 2011 at 3:56 pm

    Hi, I’m a complete novice with this kind of thing, when I copy and paste the text, I get the error “Invalid character”. I have played around with removing certain ones but to no avail. I am running Win7 x64. Please help!

  19. Anon42
    December 11, 2011 at 5:42 pm

    Since i’m not a fan of Microsoft and Apple, i use Linux…
    Could you show how to write an encryption programm in python? Thanks in advance
    I hope you make a project out of it and make an awsome prog like “keyscrambler” for linux

  20. adrian
    December 11, 2011 at 11:29 pm

    it wont work on xp

  21. mesmith
    December 12, 2011 at 1:48 pm

    i have win 7 ultimate 32 bit why doesn’t it work?!
    thanx

  22. emmet
    December 12, 2011 at 4:05 pm

    #include
    #include
    #include
    #include
    #include
    #include
    load();
    load2();
    main()
    {
    randomize();
    char message[80],ch;
    int nlenght,i;
    clrscr();
    load();
    for(;;)
    {
    printf(“Welcome to Encryption Doctor.\n”);
    printf(“\n Enter your message:”);
    gets(message);
    nlenght = strlen(message);
    for (i=0; i>>>>>>The Encrypted Message is: %s “,message);
    printf(“\n\n\n\nPress ‘1’ to Exit.”);
    printf(“\nPress ‘ENTER’ to Continue.\n”);
    ch=getch();
    if (ch==’1′)
    break; /*Program Concept From Copernicus P. Pepito’s Book ‘Introduction to Turbo C’*/
    /*Modified by:Danielle Louise S. Casoco aka. qUikSiLv3r*/
    clrscr(); /*Proudly AMA made Program*/
    }

    clrscr();
    printf(“\n\n\n\n\n\n\n\n\n\n\n\t\tProgram By:Danielle Louise S. Casoco qUiKsiLv3r”);

    return 0; /*GO!!!AMACC CALOOCAN!!*/
    }

    load()
    {
    int i;
    for(i=0;i>>\n”);
    for(x=0;x<=44;x++)
    {
    cprintf("Û");
    delay(100);
    }
    printf("\nDONE!!!!");
    return 0;
    }

  23. Mike
    December 13, 2011 at 12:07 am

    Thanks Ian, your script works excellent in Windows 7 64 bit.

  24. Anon
    December 14, 2011 at 3:13 pm

    HELP ME HELP ME I WANT TO DO THIS BUT ERRY TIME I COPYPASTA I T DOESNT WORK I NEVER READ ANY COMMENTS LOL BECAUSE IM TO STUPID TOO AND DONT UNDERSTAND BASIC PROBLEM SOLVING I WANT PEOPLE TO DO EVERYTHING FOR ME BUT I WANT TO SHOW MY FRIENDS AND TAKE THE CREDIT.

  25. Jake
    December 16, 2011 at 2:34 pm

    Anon, no one is gonna help you if you take others credits, unless someone was nice enough like me but I don’t know how I can help.

  26. Joemar
    December 17, 2011 at 9:26 am

    If its still not work on notepad and gives error, you need a code editing program like notepad++

    Copy the encrypting code save the type as visual basic file ( *.vb ; *.vbs ) and a save name with a .vbs extension once you save it, it highlighted some word with red or blue

    Delete all sentence with a ‘ before it eg. ‘SIMPLE VB ENCRYPTION PROGRAM ; ’This function encodes the text by advancing each character 3

    Change the character ” to make the sentence or word turned gray
    eg. (“Enter text to be encoded”) to (“Enter the text to be decoded”)

    After all that’s finished save it one more time and viola! it worked!

  27. joasiee
    December 17, 2011 at 9:54 pm

    I get an error with Windows script host ..

  28. Susanta
    December 29, 2011 at 1:25 pm

    This is not working for me….
    When ever i tried to open that vbs file i get an error…
    Please help me….

  29. Mohit
    January 11, 2012 at 6:38 pm

    can you make a tutorial showing how to create the intro of your videos

  30. Anthony
    January 14, 2012 at 7:29 am

    If you are having problems your problem might be how you are saving it put the name of your file lets say encryption.vbs then you want to change the save as type to all files, next you will need to go to encoding that is right next to the save button there will be a drop box where the name ANSI will be click the drop box and go down the list til you get you unicode the save the file. I did this and it worked for me.

  31. André Filipe
    André Filipe
    January 31, 2012 at 4:11 pm

    Copy and paste It will work

    ‘SIMPLE VB ENCRYPTION PROGRAM
    ‘Create a dialogue box that asks for the text to encode
    set x = WScript.CreateObject(“WScript.Shell”)
    mySecret = inputbox(“Enter text to be encoded”)
    ‘Reverse the submitted text
    mySecret = StrReverse(mySecret)
    ‘Open up an instance of Notepad to print the results after waiting for 1 second
    x.Run “%windir%\notepad”
    wscript.sleep 1000
    x.sendkeys encode(mySecret)

    ‘This function encodes the text by advancing each character 3 letters
    function encode(s)
    For i = 1 To Len(s)
    newtxt = Mid(s, i, 1)
    newtxt = Chr(Asc(newtxt)+3)
    coded = coded & newtxt
    Next
    encode = coded
    End Function

  32. André Filipe
    André Filipe
    January 31, 2012 at 4:13 pm

    you need to put spaces but if you want its very easy to get teh encryption u just need to scroll up and under the video tehres a blue lien sayign update: Download project files! you just need to download it and you have it 🙂

  33. LOL
    February 1, 2012 at 1:06 am

    Try Cracking dis $$$vhoxU#vdhugqD#qdV#DWJ

  34. LOL
    February 1, 2012 at 1:08 am

    Crack Dis
    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$ORO#ghnqduS#wrJ#xr\

  35. Jay
    February 2, 2012 at 1:58 am

    Hi i tried this and a message popped up saying,

    “Windows Script Host
    Script: C:\Users\Jason\Desktop\Encrypt.vbs
    Line: 1
    Char: 30
    Error: Invalid character
    Code: 800A0408
    Source: Microsoft VBScript compilation error”

    Is there anything I did wrong? or is it something with my version of windows? I used notepad and have Windows Starter Edition.

  36. Adam
    February 16, 2012 at 4:51 am

    Worked Like a charm, and I even advanced the characters ahead by 10 points so that the encryption will be more complex instead of just three spaces

  37. Alex
    August 2, 2012 at 1:12 pm

    The applescript version don’t works! Can someone put a link to download it?

  38. Electroalek
    August 17, 2012 at 1:49 am

    Here is all fixed:

    Encrypt:
    set x = WScript.CreateObject(“WScript.Shell”)
    mySecret = inputbox(“Enter text to be encoded”)
    mySecret = StrReverse(mySecret)
    x.Run “%windir%\notepad”
    wscript.sleep 1000
    x.sendkeys encode(mySecret)
    function encode(s)
    For i = 1 To Len(s)
    newtxt = Mid(s, i, 1)
    newtxt = Chr(Asc(newtxt)+3)
    coded = coded & newtxt
    Next
    encode = coded
    End Function
    ‘Electroalek <http://www.electroalek.blogspot.com/

    Decrypt:
    set x = WScript.CreateObject("WScript.Shell")
    mySecret = inputbox("Enter text to be encoded")
    mySecret = StrReverse(mySecret)
    x.Run "%windir%\notepad"
    wscript.sleep 1000
    x.sendkeys encode(mySecret)
    function encode(s)
    For i = 1 To Len(s)
    newtxt = Mid(s, i, 1)
    newtxt = Chr(Asc(newtxt)-3)
    coded = coded & newtxt
    Next
    encode = coded
    End Function
    'Electroalek <http://www.electroalek.blogspot.com/

    Your future looks bright !!!

  39. 12345
    October 28, 2012 at 2:02 am

    I changed mine a little.
    Decript this text and make it say message: ikewwiq

  40. sheldor
    December 24, 2012 at 11:35 pm

    ty Ian

  41. ivan4eto
    ivan4eto
    January 13, 2013 at 2:07 am

    nice work it totaly works but i was wondering from wher cani find more info about encrypting im really starting to get interested in all these hidden messages and everything that will make my stuff so hidden and behind passwords that it will take years for others to learn but if i ever learn to do this i will help everyone who needs it becouse i believe that knowedge isnt something that you can hide from the world

  42. ignacio
    January 29, 2013 at 9:22 am

    If you add an “IF” statement then you can includ “spaces” between words. It’s very simple here i show you the code…

    set x = WScript.CreateObject(“WScript.Shell”)
    mySecret = inputbox(“Enter text to be encoded”)

    mySecret = StrReverse(mySecret)

    x.Run “%windir%\notepad”
    wscript.sleep 1000
    x.sendkeys encode(mySecret)

    function encode(s)
    If Str = ” ” then
    add ” ”
    end if
    For i = 1 To Len(s)
    newtxt = Mid(s, i, 1)
    newtxt = Chr(Asc(newtxt)+3)
    coded = coded & newtxt

    Next
    encode = coded
    End Function

  43. Vincenzo
    Vincenzo
    April 10, 2013 at 12:20 am

    I have 3 questions.

    how do i get the mac version to work?
    what is the decoder for mac?
    what do i name the extension on mac?

    thanks.

  44. irfan
    April 11, 2013 at 5:21 pm

    hello can any body help me i want to encrypt a file which size is about 500kb by using this method
    then how cAN i encrypt it ……..i think lan u can help me in this problem ……….jon i also request u to help me in this situation

  45. Jackson
    April 16, 2013 at 7:41 pm

    i need some help from someone with a .vbs or tinkernut brain.
    when i tried to type “z” in the box, i got this error:
    Script: C:\Users\***PRIVATE***\Desktop\encoder.vbs
    Line: 6
    Char: 1
    Error: Invalid procedure call of argument
    Code: 800A005

    im running on windows though. the code in my .vbs might help you.

    set x = WScript.CreateObject(“WScript.Shell”)
    mySecret = inputbox(“Enter text to be encoded”)
    mySecret = StrReverse(mySecret)
    x.Run “%windir%\notepad”
    wscript.sleep 1000
    x.sendkeys encode(mySecret)

    function encode(s)
    For i = 1 To Len(s)
    newtxt = Mid(s, i, 1)
    newtxt = Chr(Asc(newtxt)+3)
    coded = coded & newtxt
    Next
    encode = coded
    End Function

    • Jackson
      April 16, 2013 at 7:43 pm

      i have never made a .vbs file, so you might want to explain why i should do the stuff you’ll tell me to do.

      • admin
        April 20, 2013 at 1:45 pm

        If you need me to tell you why you need to do it, then I suggest not doing it.

  46. Divyang
    August 2, 2013 at 5:57 am

    Sir
    Please teach me
    How can I Secure my software ?
    Also teach me
    How can I create a playback password for all computers.
    PC-Binding, One computer, One password – Each computer needs different open password.
    Users only need to enter password one time for all files that encrypted by same Encryption Key and same Product ID.

    please reply on my mail id : dksir1011@gmail.com

    Thanks
    Divyang

  47. Jack Durrant
    Jack Durrant
    October 22, 2013 at 12:49 pm

    Is there a JavaScript version of this? I can probably work with AppleScript, but I like JavaScript.

Leave a Reply