Results 1 to 19 of 19

Thread: [VB 2005] Easy File Encryption/Decryption - Only 2 Lines Of Code!

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    [VB 2005] Easy File Encryption/Decryption - Only 2 Lines Of Code!

    Just thought of a way to encrypt files and decrypt them with only two lines of code:

    Encrypt:
    Code:
    My.Computer.FileSystem.RenameFile(my.computer.filesystem.specialdirectories.mydocuments & "\text.txt", "text.enc")
    This encrypts the file: "\text.txt" >>> "\text.enc"

    You can have any extension you want as well. Just change the .enc extension.

    Decrypt:
    My.Computer.FileSystem.RenameFile(my.computer.filesystem.specialdirectories.mydocuments & "\text.enc", "text.txt")[/CODE]


    This decrypts the file: "\text.enc" >>> "\text.txt"

    If you wanna try it then try this code. It allows you to see the encryption.
    Code:
    My.Computer.FileSystem.RenameFile(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\text.enc", "text.txt")
    msgbox"Decrypted"
    My.Computer.FileSystem.RenameFile(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\text.txt", "text.enc")
    msgbox"Encrypted"
    1. Create "text.enc" file in your documents folder using notepad (or download from attachment).
    2. When the first messagebox comes up go to your documents folder and you will see the file "text.txt"
    3. Then when the 2nd messagebox comes up look in your documents again and you will see a "text.enc" file.

    Hope It Helps Someone

    -----
    knxrb
    Attached Files Attached Files
    Last edited by knxrb; Sep 7th, 2007 at 11:19 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width