Results 1 to 4 of 4

Thread: Encrypt file using VB.NET/Visual Studio 2005

  1. #1
    Join Date
    Feb 2009
    Posts
    105

    Encrypt file using VB.NET/Visual Studio 2005

    Hi Friends,

    I am newbie to the VB.Net and am currently using Visual studio 2005 to Practise with, I am doing it myself through some information from the PDF files that I have taken from my friend, I know VB.Net is very flourish language along with user friendly contents, My friend has also told me that It is also possible to Encrypt the file using VB.Net, so my curiosity wakes up know more about it, so can any there to explain me how we can achieve encryption in VB.Net.

    Thanks to those who will help!!

  2. #2
    Join Date
    Apr 2008
    Posts
    193

    Re: Encrypt file using VB.NET/Visual Studio 2005

    The System.Security.Cryptographic namespace in the .NET Framework provides a variety of tools to aid in encryption and in decryption. The CryptoStream class is one of the many classes that is provided. The CryptoStream class is designed to encrypt or to decrypt content as that content is streamed out to a file.

    To encrypt a file, follow these steps:

    1. Run Visual Studio .NET or Visual Studio 2005.
    2. Create a new console application in Visual Basic .NET or in Visual Basic 2005. A module is created for you, together with an empty Main() procedure.
    3. Use the Imports statement on the System namespace, the System.Security namespace, the System.Security.Cryptography namespace, the System.Text namespace, and the System.IO namespace. You must do this so that you do not have to qualify declarations from these namespaces later in your code. You must use these statements before any other declarations.


    Code:
    Imports System
    Imports System.IO
    Imports System.Security
    Imports System.Security.Cryptography
    Imports System.Runtime.InteropServices
    Imports System.Text
    For further details on how to Encrypt file please visit to the following site:
    http://support.microsoft.com/kb/301070

  3. #3
    Join Date
    Dec 2008
    Posts
    202

    Re: Encrypt file using VB.NET/Visual Studio 2005

    I will suggest some really simple encryption ideas here. One of these is called "exclusive OR" (XOR) encryption. The idea is that you XOR a file byte by byte to produce something that looks like a jumbled mess. But all you have to do is XOR the same file to reverse the encryption. There's an assembly language routine that can implement this method in 42 bytes! Something this simple (and easy to crack) hardly deserves the name encryption.

    If you study this program thoroughly, you should have no trouble coding your own string manipulation.

    The way this program works is to type a message into a TextBox. The unencrypted and encrypted versions of the message appear simultaneously. When you click the Stash It! button, an encrypted file and a key file are written to disk. Then you can keep the two files seperate and the information in the encypted file will be relatively safe from anyone who doesn't have the key file. To decrypt again, just input both programs into a very simple decryption program that we'll also write here and the original information is recovered.

  4. #4
    Join Date
    Mar 2008
    Posts
    232

    Re: Encrypt file using VB.NET/Visual Studio 2005

    Encryption and Decryption

    Here you have good idea about the encryption/decryption process. This block of code has been modified from an article called “Tales from the Crypto” by Billy Hollis. Here is what happens in this procedure:

    * Define the enumeration for CryptoAction (encrypt/decrypt).
    * Begin with an encrypted/unencrypted file.
    * Use a FileStream object to open and read the file.
    * Use a CryptoStream object to perform encryption/decryption.
    * Use another FileStream object to write the encrypted/decrypted file.


    For coding part please visit the following:

    http://www.codeproject.com/KB/security/EncryptFile.aspx

Similar Threads

  1. How well is supported TBB in Visual Studio 2005
    By Tamonash in forum Software Development
    Replies: 8
    Last Post: 27-09-2010, 11:59 PM
  2. Cannot debug any program on Visual Studio 2005
    By N I C K in forum Software Development
    Replies: 4
    Last Post: 22-01-2010, 08:10 PM
  3. Difference between Visual studio 2005 and Visual studio 2008
    By RohanS in forum Software Development
    Replies: 3
    Last Post: 12-06-2009, 10:48 AM
  4. Want Visual Studio 2005
    By Aashish in forum Software Development
    Replies: 1
    Last Post: 14-11-2008, 02:02 PM
  5. Error trying to install Visual Studio 2005 Pro
    By Aadimoolan in forum Window 2000 Help
    Replies: 1
    Last Post: 31-08-2007, 11:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,308,147.44340 seconds with 17 queries