Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Text Module Module1 ' Outputs the contents of Packet with Text prefix Function DisplayContents(ByVal Packet As mn.Packet, ByVal Text As String) ' Move cursor to start of packet Packet.SetCursor(0) ' Return string containing contents of packet Dim Contents As String = Packet.GetString(Packet.GetUsedSize(), True) ' Write packet contents to screen Console.WriteLine(Text) Console.WriteLine(Contents) Return (0) End Function Sub Main() ' Create key to be used when encrypting ' The 4 parameters of mnCreateKey256 act as a password ' Without these values it is impossible to decrypt the packet Dim Key As Int64 = mn.CreateKey256(1251521, 15215215, 121512515, 151252151) ' Get input Console.WriteLine("Enter data to be encrypted:") Dim Input As String = Console.ReadLine() Console.WriteLine() Console.WriteLine() ' Create packet from input Dim Packet As mn.Packet = New mn.Packet(Input) ' Display packet contents DisplayContents(Packet, "Original contents: ") ' Encrypt the packet using the key that we created earlier Packet.Encrypt(Key) ' Display encrypted contents DisplayContents(Packet, "Encrypted contents: ") ' Decrypt packet using the key that we created earlier Packet.Decrypt(Key) ' Display decrypted contents DisplayContents(Packet, "Decrypted contents: ") Console.WriteLine() Console.WriteLine("Press any key to exit...") Console.ReadKey() End Sub End Module