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
Twofish String Encryption
Visual Basic sample source code demonstrating Twofish encryption of strings. Private Sub Command1_Click()
Dim crypt As New ChilkatCrypt2
crypt.UnlockComponent "UnlockCode"
' Use the Twofish encryption algorithm
crypt.CryptAlgorithm = "twofish"
' Use 256-bit encryption.
crypt.KeyLength = 256
' Set the password to be "Secret"
crypt.SecretKey = crypt.GenerateSecretKey("Secret")
' Convert Unicode string to iso-8859-1 before encrypting.
crypt.Charset = "iso-8851-1"
' We want the output in string form, so encode it
' using hex. We could also use "base64" here.
crypt.EncodingMode = "hex"
' Encrypt...
Text2.Text = crypt.EncryptStringENC(Text1.Text)
' Decrypt...
Text3.Text = crypt.DecryptStringENC(Text2.Text)
End Sub
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.