[TUT] ROT13 Encryption
Hello, i thought i would share a method of encryption i have learnt in visual basic just to help out anyone who may be needing something like this 
I found this code in my module library, if you paste that code into a command button it will work and will give you a rough idea of how the encryption works allowing you to use it other programs. In my full program I had this code encrypting a page full of data saving it to a text file which could be loaded up back into the program and decrypted again.
If anyone would like me to post the code of how to save the information to a text file and how to decrypt it then I would be more than happy to.
To start off declare your variables as either locals or globals
In your command button you will want to type out this code to get the program working correctly. Feel free to tweak the code to use other methods such as text boxes or whatever way you feel most comfortable.
Basically the ROT13 method takes each character entered and moves it up 13 places on the ascii table making it unreadable. To decrypt it you just move each character in your encrypted string 13 places down the ascii table. Like i said above if anyone would like the saving and decryption posted just say below.
PS. Code will work in either VB6 or VB.NET
I am new to this site so criticism on how to make my tutorials better are greatly appreciated as I want people to actually learn from this and not just copy and paste
Thanks.

I found this code in my module library, if you paste that code into a command button it will work and will give you a rough idea of how the encryption works allowing you to use it other programs. In my full program I had this code encrypting a page full of data saving it to a text file which could be loaded up back into the program and decrypted again.
If anyone would like me to post the code of how to save the information to a text file and how to decrypt it then I would be more than happy to.
To start off declare your variables as either locals or globals
Code:
'-------------------------------------------------------------------
'Delcaring variables
'-------------------------------------------------------------------
Dim n As Integer, i As Integer
Dim EnteredText As String
Code:
'-------------------------------------------------------------------
'Rot 13 encryption
'-------------------------------------------------------------------
'Sets the change in Ascii characters
n = 13
'Sets the counter to 0
i = 0
'Instanciates the variable by making it equal to the entered text
EnteredText = InputBox("Enter the string in which you wish to encrypt")
'Encryption of the string
For i = 1 To Len(EnteredText)
Mid(EnteredText, i, 1) = Chr(Asc(Mid(EnteredText, i, 1)) + n)
Next i
MsgBox(EnteredText)
PS. Code will work in either VB6 or VB.NET
I am new to this site so criticism on how to make my tutorials better are greatly appreciated as I want people to actually learn from this and not just copy and paste

Thanks.
to encrypt/
