Results 1 to 15 of 31

Threaded View

  1. #1
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused

    [TUT]Basic Encrypter\Decrypter

    1. Create a new project
    2. Add 2 textboxes. Textbox1 being single lined and textbox2 being multiline
    3. Add 2 buttons. Button1 text being encrypt and button2 text being decrypt
    4. Go into the coding. Unde public class form 1 put-
    Code:
    Dim DES AsNew System.Security.Cryptography.TripleDESCryptoServiceProvider
    Dim Hash AsNew System.Security.Cryptography.MD5CryptoServiceProvider
    5. Under button1(encrypt) click put-
    Code:
    Try
    DES.Key = Hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(TextBox1.Text))
    DES.Mode = Security.Cryptography.CipherMode.ECB
    Dim DESEncrypter As System.Security.Cryptography.ICryptoTransform = DES.CreateEncryptor
    Dim Buffer AsByte() = System.Text.ASCIIEncoding.ASCII.GetBytes(TextBox2.Text)
    TextBox2.Text = Convert.ToBase64String(DESEncrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
    Catch ex As Exception
    MessageBox.Show("The following error(s) have occurred: " & ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
    EndTry
    
    6. Under Button 2(decrypt) put-
    Code:
    Try
    DES.Key = Hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(TextBox1.Text))
    DES.Mode = Security.Cryptography.CipherMode.ECB
    Dim DESDecrypter As System.Security.Cryptography.ICryptoTransform = DES.CreateDecryptor
    Dim Buffer AsByte() = Convert.FromBase64String(TextBox2.Text)
    TextBox2.Text = System.Text.ASCIIEncoding.ASCII.GetString(DESDecrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
    Catch ex As Exception
    MessageBox.Show("The following error(s) have occurred: " & ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
    EndTry
    
    Now how to use this. Textbox1 is like an encryption key. To decrypt a message it must be the same key as used originally Ex:
    If you put 1337 in textbox 1 and put Hai! in textbox2 if you put 1336 in textbox1 and try to decrypt textbox2 it will give you an error.
    So Textbox1 is the encryption key, and textbox2 is the message to encrypt/encrypted message

    For you lazy people heres da full code:
    Code:
    PublicClass Form1
    Dim DES AsNew System.Security.Cryptography.TripleDESCryptoServiceProvider
    Dim Hash AsNew System.Security.Cryptography.MD5CryptoServiceProvider
    PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
     
    EndSub
    PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Try
    DES.Key = Hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(TextBox1.Text))
    DES.Mode = Security.Cryptography.CipherMode.ECB
    Dim DESDecrypter As System.Security.Cryptography.ICryptoTransform = DES.CreateDecryptor
    Dim Buffer AsByte() = Convert.FromBase64String(TextBox2.Text)
    TextBox2.Text = System.Text.ASCIIEncoding.ASCII.GetString(DESDecrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
    Catch ex As Exception
    MessageBox.Show("The following error(s) have occurred: " & ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
    EndTry
    EndSub
    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Try
    DES.Key = Hash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(TextBox1.Text))
    DES.Mode = Security.Cryptography.CipherMode.ECB
    Dim DESEncrypter As System.Security.Cryptography.ICryptoTransform = DES.CreateEncryptor
    Dim Buffer AsByte() = System.Text.ASCIIEncoding.ASCII.GetBytes(TextBox2.Text)
    TextBox2.Text = Convert.ToBase64String(DESEncrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
    Catch ex As Exception
    MessageBox.Show("The following error(s) have occurred: " & ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
    EndTry
    EndSub
    EndClass
    
    I attached my version of it. Here is the virus scans --> VirusTotal, VirScan
    For those of you who think i C&P *cough*hesjan*cough* i dindt look at the attachment its my original encryptor/decryptor made in january of '09. Plus the british kid sounds like hes 11
    Last edited by Bombsaway707; 11-30-2009 at 12:07 PM.

  2. The Following 6 Users Say Thank You to Bombsaway707 For This Useful Post:

    -MAJ (02-23-2013),Katy (07-27-2012),Lolland (11-29-2009),mnpeep (11-30-2009),RawVb (12-01-2009),XGelite (11-30-2009)

Similar Threads

  1. [TUT] Basic Skining with photoshop
    By No5cope in forum Combat Arms Mod Tutorials
    Replies: 36
    Last Post: 07-11-2010, 06:13 PM
  2. [TUT] Basic HTML
    By alexrules057 in forum Web Languages
    Replies: 21
    Last Post: 01-31-2010, 01:03 AM
  3. [Vid tut] Basic Game Hacking
    By Matrix_NEO006 in forum Programming Tutorials
    Replies: 5
    Last Post: 01-02-2010, 10:43 AM
  4. [TUT] Basic Cheat Engine tutorial for begginers
    By rawr161 in forum Programming Tutorials
    Replies: 2
    Last Post: 08-14-2009, 06:41 AM
  5. Basic Encryption
    By Calard in forum General Game Hacking
    Replies: 0
    Last Post: 02-23-2007, 06:32 AM

Tags for this Thread