Page 1 of 1

Create Your Own Encrypting and Decrypting Program

Posted: Sun Feb 28, 2010 8:06 am
by Ximster
Hey All... This is a tutorial on creating your own encrypting and decrypting application (With save and open function)

Stuff you need to add on form one..:

1 Tab Control:
- Page 1 Title : Encrypt Text
- Button 1 : Encrypt Text
- Show Encrypted Text Button : (Name) = showencrypt
- Textbox1

- Page 2 Title : Decrypt Text
- Button 2 : Decrypt Text
- Show Decrypted Text Button : (Name) = showdecrypt
- Textbox2

- Page 3 Title : Save Encrypted Text File
- Button 3 : Save

- Page 4 Title : Open Encrypted text File
- Button 4 : Open

-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
(So in total... it's:)
Button 1 - Encrypt Text
Button 2 - Decrypt Text
Button 3 - Save Encrypted Text File
Button 4 - Open Encrypted Text File
And Extra 2 Buttons: (Name) = showencrypt & (Name:) = showdecrypt

And you need 2 new forms:
Form2 should be EncryptedText.vb
Form3 should be DecryptedText.vb

And in EncryptedText Form, Add a Text Box, And same in DecryptedText Form

----
Now to the coding part....
----

Code For Button1:

Dim 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 As String
Dim outcome As String

a = "a"
b = "b"
c = "c"
'And so on....

outcome = TextBox1.Text

outcome = Replace(outcome, a, "01")
outcome = Replace(outcome, b, "02")
outcome = Replace(outcome, c, "03")

'... And so on... Tutorial might seem long if i pasted the whole thing so... I'll upload it to some other page..
'And then i'll leave the link at the bottom..

'This part of the code is for changing the capital letter...
outcome = Replace(outcome, "A", "01")
outcome = Replace(outcome, "B", "02")
outcome = Replace(outcome, "C", "03")
MsgBox("Text Decryption Successful")
EncryptedText.TextBox1.Text = outcome

Code For Button2:

Dim 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 As String
Dim outcome As String

a = "a"
b = "b"
c = "c"
'And so on....

outcome = TextBox2.Text

outcome = Replace(outcome, "01", "a")
outcome = Replace(outcome, "02", "b")
outcome = Replace(outcome, "03", "c")
'And so on....

outcome = Replace(outcome, "01", "A")
outcome = Replace(outcome, "02", "B")
outcome = Replace(outcome, "03", "C")
'And so on....

MsgBox("Text Decryption Successful")
DecryptedText.TextBox1.Text = outcome
Code For Button 3:

If EncryptedText.TextBox1.Text = "" Then
MsgBox("You Did Not Encrypt Any Text!")
Else
Dim SaveFile As New SaveFileDialog
SaveFile.FileName = ""
SaveFile.Filter = "Encrypted_Text|*.Encrypted_Text"
SaveFile.Title = "Save"
SaveFile.ShowDialog()
Try
Dim Writer As New System.IO.StreamWriter(SaveFile.FileName)
Writer.Write(EncryptedText.TextBox1.Text)
Writer.Close()
Catch ex As Exception
End Try

Code For Button 4:

Dim Open As New OpenFileDialog()
Dim myStreamReader As System.IO.StreamReader
Open.Filter = "Encrypted_Text|*.Encrypted_Text"
Open.CheckFileExists = True
Open.Title = "OpenFile"
Open.ShowDialog(Me)
Try
Open.OpenFile()
myStreamReader = System.IO.File.OpenText(Open.FileName)
TextBox2.Text = myStreamReader.ReadToEnd()
TabPage2.Select()
TabPage2.Show()
Catch ex As Exception
End Try

Code For "showencrypt":

EncryptedText.Show()

Code For "showdecrypt":

DecryptedText.Show()

---------------------------------------------------------------------
---------------------------------------------------------------------

See Full Tutorial At:

http://tinyurl.com/yfuad9v

Download Full Code At:

http://www.multiupload.com/NAQKYV1PVZ

Re: Create Your Own Encrypting and Decrypting Program

Posted: Mon Mar 08, 2010 3:21 pm
by EwoudVL
Works perfect, very nice cooll; !

Re: Create Your Own Encrypting and Decrypting Program

Posted: Sun Mar 21, 2010 3:49 am
by 35000vr
Thank you for the tutorial cooll;

Re: Create Your Own Encrypting and Decrypting Program

Posted: Sat Apr 10, 2010 11:45 am
by Philipp
Working sooo perfect!!!

Re: Create Your Own Encrypting and Decrypting Program

Posted: Sun Apr 11, 2010 8:59 am
by Ximster
....Cool,........

Re: Create Your Own Encrypting and Decrypting Program

Posted: Sun Apr 18, 2010 11:09 am
by DreadNought
I cant seem to get it to work anybody got a VB source they can give me please ?

Re: Create Your Own Encrypting and Decrypting Program

Posted: Mon Apr 19, 2010 11:37 pm
by Ximster
paralyzer wrote:
I cant seem to get it to work anybody got a VB source they can give me please ?
whats the problem man,...

*Make sure u name all the forms and text boxes same like in the code (ex: Form2 should be EncryptedText.vb and Form3 should be DecryptedText.vb)

Please PM me with the exact problem you are having....

Re: Create Your Own Encrypting and Decrypting Program

Posted: Mon Apr 19, 2010 11:48 pm
by Ximster
PLEASE NOTE THAT YOU MIGHT GET SOME ERROR WITH THE LETTER "E" *Or Some Other) So if you do just change the ("e = "e") to ("ee = "e")