Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.js

Python Examples

Async
Certificates
ECC
Email Object
Encryption
FTP
HTML-to-XML/Text
Gzip
HTTP
IMAP
JSON
MHT / HTML Email
PEM
PFX/P12
Java KeyStore (JKS)
POP3
RSA Encryption
MIME
SCP
SMTP
Socket/SSL/TLS
SSH Key
SSH
SFTP
Stream
Tar Archive
XML
XMP
Zip

More Examples...
OpenSSL
ASN.1
PRNG
Amazon S3
Bounced Email
CSV
Diffie-Hellman
DKIM / DomainKey
NTLM
QuickBooks

 

 

 

 

 

 

 

AES String Encryption

AES string encryption in Python.

Chilkat Python Downloads

Python Module for Windows, Linux, MAC OS X,
Solaris, FreeBSD, and ARM Embedded Linux

import sys
import chilkat

crypt = chilkat.CkCrypt2()

success = crypt.UnlockComponent("Anything for 30-day trial")
if (success != True):
    print "Crypt component unlock failed"
    sys.exit()

password = "secretPassPhrase"

crypt.put_CryptAlgorithm("aes")
crypt.put_CipherMode("cbc")
crypt.put_KeyLength(128)

#  Generate a binary secret key from a password string
#  of any length.  For 128-bit encryption, GenEncodedSecretKey
#  generates the MD5 hash of the password and returns it
#  in the encoded form requested.  The 2nd param can be
#  "hex", "base64", "url", "quoted-printable", etc.
hexKey = crypt.genEncodedSecretKey(password,"hex")
crypt.SetEncodedKey(hexKey,"hex")

crypt.put_EncodingMode("base64")
text = "The quick brown fox jumped over the lazy dog."

#  Encrypt a string and return the binary encrypted data
#  in a base-64 encoded string.
encText = crypt.encryptStringENC(text)

print encText

#  Decrypt and show the original string:
decryptedText = crypt.decryptStringENC(encText)

print decryptedText
 

© 2000-2014 Chilkat Software, Inc. All Rights Reserved.