Welcome to www.programmer2programmer.net Its all about security programming source code


 Microsoft Certification
 Final Year Project Idea
 Connection Strings
 Password Recovery
 SQL Injection
 Encryption & Decryption
 LIVE Academic Project
 Project #1 - VB6, Access
  Project #2 - VB.Net, SQL
 Project #3 - ASP, Access
 Project #4 - ASP.NET, C#
 Project #5 - VB6, SQL
 Project #6 - Stegano
 Project #7 - C
 Project #8 - C++
 Project #9 - JAVA, MySQL
 Project #10- PHP, MySQL
 Project #11- JSP, Oracle
 Project #12- C# Face Exp
 Project #13- Mobile Bank
 Download MBA Project
 MBA Project Topic
 Project Viva Question
  2018 New Projects
 Project Synopsis Download
 University Question Paper, Assignment and Projects
 SMU - Question Paper
 SMU - Assignment
 SMU - Synopsis Projects
 SCDL - Assignment
 IGNOU - Synopsis Projects
 Welingkar - Projects
 Project Report Formats
 Interview Question Answer
 General & HR Round
 Visual Basic 6
 VB.Net & C#
 SQL Server
  Oracle and DBA

100% Tested
Ready Academic IT Projects


 Free Visual Basic .NET source code download of P2P Secure File, Encrypt and Decrypt any file with password

Home Personal Member Forum Source Project Tips Contact

P2P Secure File


P2P Secure File, Encrypt and decrypt any file with password. Secure File program written in VB.Net. Click here to Download the source code.


Protect any file by encryption and decryption with password. It encrypt the file and saved as secure XML with binary format, and stored file password as custom PK encrypter routine. This P2P Secure File program source code written in Visual Basic .NET programming language is capable of encrypt and decrypt any file. It converts any file into byte array and convert byte array to stream and write it into xml file with *.sp2p extension.

1. Encryption / Decryption


2. XOR Encryption

3. Transposition Encryption
4. Symmetric Encryption
5. Asymmetric Encryption
6. Certificate Authority

7. Decryption Logics

8. Sample Coding

Next : Transposition Encryption

Screen shot

Fig 1 : Secure File Main Screen

Fig 2 : Secure File Start Encryption

Fig 2 : Secure File Start Decryption


Step 1 :

First Select a file convert the file content into Byte array for that we create FileStream object and pass this FileStream object to BinaryReader to get the raw bytes.

 Dim Fs As New System.IO.FileStream(FileName, System.IO.FileMode.Open)
 Dim bn As New System.IO.BinaryReader(Fs)

Step 2 :
Now create a DataTable to a DataSet to store all the details including file name, binary content and encrypted password

        Dim DsImg As New DataSet
        Dim Dt As New DataTable("Images")

        Dt.Columns.Add(New DataColumn("sysid", _
        Dt.Columns.Add(New DataColumn("filename", _
        Dt.Columns.Add(New DataColumn("image", _
        Dt.Columns.Add(New DataColumn("filetag", _


Step 3 :
Now add the data to the DtataTable and write XML file with *.sp2p extension, encrypt password with custom PK encryption. If you want you can encrypt the binary content, I left this to the users.

        Dim Dr As DataRow
        Dr = DsImg.Tables("images").NewRow
        Dr("sysid") = Now.ToString
        Dr("filename") = TxtFileName.Text
        Dr("image") = bn.ReadBytes(Int(bn.BaseStream.Length))
        Dr("filetag") = StrEncrypt(TxtPassword.Text)

        '>>> write xml file from dataset with binary content
        DsImg.WriteXml(TxtFileName.Text & ".sp2p")

Step 4 :
For decryption we load the xml file into dataset, then decrypt the password to check with supplied password, If it match. Read content from dataset into byte array and write into file stream, remove .sp2p from the final decrypted file.

 Dim Content As Byte()
 Content = DsImg.Tables(0).Rows(0).Item(2)

Fs As New System.IO.FileStream(FileName, System.IO.FileMode.Create)
 Fs.Write(Content, 0, Content.Length)

Download the source code and project files


It is free to download, source code are well commented, complete visual basic .net source code can be download from the download link. I did not claim any copyright for this P2P Secure File program and source code. You can freely download this P2P Secure File program and use all or part of this program as you want. This is tested and live project visual basic source code however, my advice to you that you should take a backup of your original file before use this P2P Secure File program and do not forget the encryption password.

  Language: Visual Basic   Platform: Win 2000, Win XP
  Category: Security Program   Cost: $0.0
  Copyright: NO   Source Code: YES
  Size: 95 KB   Download: 1177 Times
  No of Files: 15


(C) Atanu Maity, 2006-2007