Tutorial - Rot13/Rot-N Encryption-VBForums
Results 1 to 3 of 3

Thread: Tutorial - Rot13/Rot-N Encryption

  1. #1

    Thread Starter
    Addicted Member prophecy's Avatar
    Join Date
    Mar 2005
    Location
    In the developers list of Visual Basic ;-)
    Posts
    242

    Tutorial - Rot13/Rot-N Encryption

    - |Rot13/Rot-N Encryption Tutorial| -

    What is Rot13 encryption?
    Rot13 simple means rotating alphabet by 13 characters. It is a very primitive encryption method which can be easily decrypted on knowledge. But for a non-technical user it still remains an unsolved mystery. Rot13 encryption is very easy to understand and use. It is very similar to the Caesar-Encryption method. Here what we do is rotate the character backwards or front by 13 characters in the ASCII table. The means "a" becomes "n" and "p" becomes "}". This method has been used in many news delivery systems as to prevent third parties from gaining easy access to it in the past. But now there are many better encryption systems being used which remain hard to be decrypted. Rot13 uses very simple algorithms and the encryption/decryption functions can be easily made.

    What is Rot-N encryption?
    Rot13 and Rot-N are very similar with the only exception that Rot-N encryption rotates each character by any number of digit rather than 13. It is basically a number between 1 to 25 so it remains within the ASCII table.

    Here is a simple visual basic function for encrypting/decrypting a string:-
    Rot-13 was basically made only for typed characters and not any extra signs or special characters so trying characters like "?ot; would cause the program to fail. Anyways you can modify the function to fit all special characters too.

    Visual Basic Functions:
    VB Code:
    1. Public Function encrypt(strInput As String)
    2.     Dim n As Integer, i As Integer
    3.     n = 13
    4.     For i = 1 To Len(strInput)
    5.         Mid(strInput, i, 1) = Chr(Asc(Mid(strInput, i, 1)) + n)
    6.     Next i
    7.     encrypt = strInput
    8. End Function
    VB Code:
    1. Public Function decrypt(strInput As String)
    2.     Dim n As Integer, i As Integer
    3.     n = 13
    4.     For i = 1 To Len(strInput)
    5.         Mid(strInput, i, 1) = Chr(Asc(Mid(strInput, i, 1)) - n)
    6.     Next i
    7.     decrypt = strInput
    8. End Function

    The variable n specifies the number of characters with which it rotates.
    Variable i is used to loop through each character and then rotate it n characters forward or backward.

    To increase the strength of the encryption, you can further tweak the code a bit like reversing the string or converting every alternate character to Ucase and using numbers to enhance encryption.

    Here is a sample program I made in Visual Basic 6 that clearly explains this method of encryption.


    Download Now [Exe + Source Code]


    - Written By,
    - Dayson Pais
    - www.compzone.hhnf.com

    Authors Name: Dayson Pais
    Description: Rot13/Rot-N Encryption Tutorial
    Level: Beginners
    License info: Tutorial is Copyright Protected CompZone.hhnf.com
    The code can be used and modified by anyone. I shall not be held responsible for any reflected offense.
    Attached Files Attached Files
    Last edited by si_the_geek; Jun 19th, 2005 at 05:35 PM. Reason: changed Title format

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    39,435

    Re: Tutorial - Rot13/Rot-N Encryption

    The code/files within this thread (submitted: 6-17-2005) have been checked for malware by a moderator.

    Disclaimer: This does not necessarily mean that any compiled files (DLL/EXE/OCX etc) are completely safe, but any supplied code does not contain any obvious malware. It also does not imply that code is error free, or that it performs exactly as described.

    It is recommended that you manually check any code before running it, and/or use an automated tool such as Source Search by Minnow (available here or here).
    If you find any serious issues (ie: the code causes damage or some sort), please contact a moderator of this forum.

    Usage of any code/software posted on this forum is at your own risk.

  3. #3
    Registered User
    Join Date
    May 2015
    Posts
    1

    Thumbs up Re: Tutorial - Rot13/Rot-N Encryption

    Can you post the .vbproj file for this program? I run Visual Basic 2010 and your source files don't open in it. Please upload the .vbproj file for it. You can email it to me at: bharadwaj.raju777@gmail.com. Also, how did you make those 2-way text boxes? I just can't seem to figure it out. By the way, awesome program!

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.