Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Blowfish Encryption Matching Published Test VectorsDownload: Chilkat .NET Assemblies This VB.NET example program demonstrates how to use Chilkat Crypt2 w/ the blowfish encryption algorithm to match the published test vector results. ' Blowfish encrypt data to get a result that agrees with published test vectors ' key bytes clear bytes cipher bytes '0000000000000000 0000000000000000 4EF997456198DD78 '0123456789ABCDEF 1111111111111111 61F9C3802281B096 ' ' Test vector data located at: http://www.schneier.com/code/vectors.txt ' ' key bytes ' clear text ' cipher text ' 0123456789ABCDEF 1111111111111111 61F9C3802281B096 Dim crypt2 As New Chilkat.Crypt2() crypt2.UnlockComponent("Anything for 30-day trial") ' Use "blowfish2" for the Blowfish algorithm. crypt2.CryptAlgorithm = "blowfish2" crypt2.KeyLength = 64 crypt2.PaddingScheme = 3 Dim key As String key = "0123456789ABCDEF" Dim clearText As String clearText = "1111111111111111" Dim keyBytes As Byte() keyBytes = crypt2.Decode(key, "hex") crypt2.SecretKey = keyBytes Dim clearBytes As Byte() clearBytes = crypt2.Decode(clearText, "hex") Dim eBytes As Byte() eBytes = crypt2.EncryptBytes(clearBytes) MessageBox.Show(crypt2.Encode(eBytes, "hex")) |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.