Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Classic ASP Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

EncryptEncoded: Decode-->Encrypt Bytes-->Encode

In some programming languages, it is very difficult to work with binary data. To help avoid these problems, two new methods have been added to the Chilkat Crypt2 component: EncryptEncoded and DecryptEncoded.

EncryptEncoded takes binary data in the form of an encoded string (base64, hex, etc.), decodes it, encrypts, and then encodes the encrypted output and returns an encoded string (base64, hex, etc.).

DecryptEncoded does the opposite. It accepts encrypted data in the form of an encoded string, decodes, decrypts, and then returns the result as an encoded string.

The encoding is determined by the EncodingMode property. It may be "base64", "hex", "url", "quoted-printable", etc.

Note: The EncryptEncoded and DecryptEncoded methods are unreleased at the time of this writing (08-April-2008) The next major Chilkat Crypt2 release after this date will include these new methods.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set crypt = Server.CreateObject("Chilkat_9_5_0.Crypt2")

success = crypt.UnlockComponent("Anything for 30-day trial")
If (success <> 1) Then
    '  Unlock failed.
    Response.Write crypt.LastErrorText & "<br>"

End If

crypt.CryptAlgorithm = "aes"
crypt.KeyLength = 128

'  The encrypted output will be a hex-encoded string.
'  It is also possible to use "base64", "url" (for url-encoding), and other modes.
crypt.EncodingMode = "hex"

'  Both ECB and CBC modes are available.
'  Use "ecb" for Electronic Cookbook Mode.
'  "cbc" is for Cipher-Block-Chaining.
crypt.CipherMode = "ecb"

'  Key (128): E8E9EAEBEDEEEFF0F2F3F4F5F7F8F9FA
'  Plaintext: 014BAF2278A69D331D5180103643E99A
'  Ciphertext: 6743C3D1519AB4F2CD9A78AB09A511BD

crypt.SetEncodedKey "E8E9EAEBEDEEEFF0F2F3F4F5F7F8F9FA","hex"

crypt.PaddingScheme = 3

cipherHex = crypt.EncryptEncoded("014BAF2278A69D331D5180103643E99A")
Response.Write Server.HTMLEncode( cipherHex) & "<br>"

plainTextHex = crypt.DecryptEncoded(cipherHex)
Response.Write Server.HTMLEncode( plainTextHex) & "<br>"
%>
</body>
</html>

 

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