How To Make Your Own Encryption

Avatar davisde | December 10, 2011

73 Views 0 Ratings Rate it

****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——>

Comments

This post currently has 62 responses.

    • 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

    • 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

    • 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.

    • 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. )

  1. 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!!!!

  2. 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;
    }

  3. 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??

  4. 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!

  5. 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

  6. 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;
    }

  7. 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.

  8. 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!

  9. 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.

  10. 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

  11. 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 🙂

  12. 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.

  13. 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 !!!

  14. 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

  15. 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

  16. 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

  17. 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

  18. 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

Leave a Reply