Results 1 to 5 of 5
  1. #1
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed

    [Tutorial] Encryption

    Create a Encryption Program

    First, I want to start with the basic fundementals of Cipher, Once you understand the concepts and differences in cipher
    you will be able to take what you learn here and the knowledge of cipher and it's history and you can easily begin creating
    your own cipher programs

    Source Wikipedia

    Cipher : In cryptography, a cipher (or cypher) is an algorithm for performing encryption or decryption — a series of well-defined steps that can be followed as a procedure. An alternative, less common term is encipherment.

    You may not realize it, but when you were (or are) in school, You may either use the following form of cypher and not realize that what it is

    Shift Cypher (Common) Note' Also known as Ceasers Cipher

    It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 3, A would be replaced by D, B would become E, and so on. The method is named after Julius Caesar, who used it to communicate with his generals.(source wikipedia) (I learned the name and it's uses in Digital Fortress by: Dan Brown , A must read for Computer Guru's)

    The great thing about the Shift Cipher is it can be different every time, but the down side is it is easy to crack, once someone realizes you are using a shift cipher, it's only a matter of time before they deduce the pattern

    Code:
    Example:
    Plain:   ABCDEFGHIJKLMNOPQRSTUVWXYZ
    Cipher:  DEFGHIJKLMNOPQRSTUVWXYZABC
    or 
    
    Plain:   ABCDEFGHIJKLMNOPQRSTUVWXYZ
    Cipher:  HIJKLMNOPQRSTUVWXYZABCDEFG
    
    or anyway you would like to start
    A Commonly Used, Harder to Crack Cipher is the XOR Cipher or XOR encryption (Microsoft developers used this a lot in it's OS' to protect login information)

    Source: Wikipedia In cryptography, the simple XOR cipher is a simple encryption algorithm that operates according to the principles
    Code:
    A  0 = A,
    A  A = 0,
    (B  A)  A = B  0 = B,
    where  denotes the exclusive disjunction (XOR) operation. With this logic, a string of text can be encrypted by applying the bitwise XOR operator to every character using a given key. To decrypt the output, merely reapplying the key will remove the cipher.
    For example, the string "Wiki" (01010111 01101001 01101011 01101001 in 8-bit ASCII) can be encrypted with the key 11110011 as follows:
                01010111 01101001 01101011 01101001
    	11110011 11110011 11110011 11110011
    =	10100100 10011010 10011000 10011010
                And conversely, for decryption:
                10100100 10011010 10011000 10011010
    	11110011 11110011 11110011 11110011
    =	01010111 01101001 01101011 01101001
    The point of mentioning this is to show you there are no limitations, you can make this program as simple or as advanced as you like, use the concept below and use an existing mathematical algorithmic or develop your own.
    _________________________________________________


    We will be using a simple math algorithm in this tool, the reason I am choosing a math algorithm is simply because you can use any combination of math you like, changing the encryption and making it entirely different from this one, making it even harder to decrypt, even if someone was to happen by this code while browsing.

    However you can use the same concept to apply any algorithm, including Caesars (Shift Cypher) and XOR and the hundreds of other algorithm that exist, but the more complex the encryption, the more complex the code(sort of)

    O.K Lets Start:

    As Always, Lets create a new project, Call it something like Encrypt

    On your form add 3 Text Box's and 3 Labels and 2 buttons



    Set Two of your textbox's to "Multi Line" and set Scrollbars to Vertical



    Arrange the TextBox's and Buttons anyway you like (anyway that makes sense and works for you, and your application)

    Note: I chose the top to bottom method, maybe best for those just learning this, then once you realize how the software functions, you can move things around to suit your needs



    Change the Text of each of your labels and buttons to

    Label1 = "Password [8-24 char]"
    Label2 = "Text to Decrypt or Encrypt"
    Label3 = "Result of Encryption or Decryption"

    Or whatever you like, have fun with it, make it your own

    Next Change the Text on the buttons to
    Button1 = Encrypt
    Button2 = Decrypt

    Your final product (UI) should look something like this (something like)



    Now onto the code part

    as always I will try and notate everything you may need to know

    Code:
    ' Description:This code is used in making a Encryption Tool 
    ' By: NextGen1 of Mpgh.net
    ' This code is copyrighted and comes  with no warranties.
    ' This code is intended for demonstration and all rights are granted soley to mpgh.net and it's members
    ' If you require any further information please contact me at mpgh.net via PM (Get an account if you don't have one) 
    ' Tutorials and apps create by me for mpgh.net will contain the following agreement 
    ' By adding this code in whole or part to any existing or new application you agree to the following terms 
    ' You agree to keep these notes connected with this code.
    ' You agree to grant credit to it's source (Mpgh.net)   
    ' You agree to keep this note in whole without edit inside of your code
    
    Public Class Form1
    
        Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
            Dim PassInt As Integer
            Dim i As Integer
    
            PassInt = GetIntegerFromPassword(TextBoxX1.Text)
            TextBoxX3.Text = ""
    
    
            For i = 1 To Len(TextBoxX2.Text)
    
                'this part decrypts the message by doing the opposite mathamatical equastion as givin in encrypt, in my example
                ' I used "/ 2 / 3 / 4 / 5 / 6" which divides, so to revers, we must do the opposite and multiply
                TextBoxX3.Text = String.Concat(TextBoxX3.Text, Chr(Asc(Mid(TextBoxX2.Text, i, 1)) / PassInt * 2 * 3 * 4 * 5 * 6))
    
            Next i
    
        End Sub
    #Region "Transform operations, from Chars to Int and viceversa."
    
        Function GetIntegerFromPassword(ByVal Password As String) As Integer
            Dim i As Integer
            Dim passedt As Integer
            'Passes across the entire String 
            'Convert Password to integer
            For i = 1 To Len(Password)
                passedt = passedt + Asc(Mid(Password, i, 1))
            Next
    
    
            'returns the new integer
            Return passedt
    
        End Function
    
    #End Region
    
        Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
            Dim PassInt As Integer
            Dim i As Integer
    
            ' Converts password into Numeric value
    
            PassInt = GetIntegerFromPassword(TextBoxX1.Text)
            TextBoxX3.Text = ""
    
            'Converts the message
            'You can use any mathimatical forumla you want here
    
            For i = 1 To Len(TextBoxX2.Text)
    
                TextBoxX3.Text = String.Concat(TextBoxX3.Text, CStr(Chr(CInt(Asc(Mid(TextBoxX2.Text, i, 1)) * PassInt / 2 / 3 / 4 / 5 / 6))))
    
            Next i
        End Sub
    
      
    End Class
    Results of my test below,

    I set password to
    "gotohellordie"

    The Text to encrypt was
    "Hello, How are you? , Meet me at the movies"

    The result was
    "&599;&;?3<5@;>)55=:53==75:;>85="

    Go ahead, have fun with it, try and come up with crazy equations, make it harder to work out. Enjoy it

    Screen Shots



    Virus Scan Eample

    Virus Scan Source

    Sample Program

    Source Code


    Note: as always, you may need to edit the sample code to match your controls and their names.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  2. The Following 5 Users Say Thank You to NextGen1 For This Useful Post:

    Paul (06-29-2012),Sketchy (09-01-2011),Web-Designer (12-04-2010),XGelite (02-23-2010),Zoom (01-19-2010)

  3. #2
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,004
    My Mood
    Flirty
    Holey shiz.
    Thats cool

  4. #3
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by ac1d_buRn View Post
    Holey shiz.
    Thats cool
    Thanks, trying to add a lot of tuts to vb section (this one happens to be my favorite so far)


     


     


     



    The Most complete application MPGH will ever offer - 68%




  5. #4
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,971
    My Mood
    Happy
    AWESOME nextgen1! You´re awesome!
    -Rest in peace leechers-

    Your PM box is 100% full.

  6. #5
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by hejsan1 View Post
    AWESOME nextgen1! You´re awesome!
    Thanks , Plenty more to come, I am aiming for 3 or 4 a day.


     


     


     



    The Most complete application MPGH will ever offer - 68%




Similar Threads

  1. [Tutorial] Change your IP to unban yourself
    By Super-Man in forum Game Hacking Tutorials
    Replies: 3
    Last Post: 10-13-2019, 03:33 AM
  2. Warrock Hack - Tutorial
    By Dave84311 in forum WarRock - International Hacks
    Replies: 667
    Last Post: 10-09-2007, 10:10 AM
  3. Gunz Hack - Tutorial
    By Dave84311 in forum General Game Hacking
    Replies: 12
    Last Post: 01-09-2006, 08:16 PM
  4. Replies: 3
    Last Post: 01-04-2006, 09:52 PM
  5. Photoshop Tutorials
    By Dave84311 in forum Art & Graphic Design
    Replies: 3
    Last Post: 12-31-2005, 07:21 AM