Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Unicode C++ Examples

Web API Categories

ASN.1
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
Geolocation
Google APIs
Google Calendar
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
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(Unicode C++) WPA Key Calculation from PassPhrase to Hex

Demonstrates how to calculate a WPA key from a passprhase and network SSID.

Chilkat C/C++ Library Downloads

MS Visual C/C++

Linux/CentOS C/C++

Alpine Linux C/C++

MAC OS X C/C++

armhf/aarch64 C/C++

C++ Builder

iOS C/C++

Android C/C++

Win Mobile 5.0/Pocket PC 2003

Solaris C/C++

FreeBSD C/C++

OpenBSD C/C++

MinGW C/C++

#include <CkCrypt2W.h>

void ChilkatSample(void)
    {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkCrypt2W crypt;

    const wchar_t *wpaHexKey = 0;

    // The "ps" is the WPA passphrase
    const wchar_t *pw = L"password";
    const wchar_t *pwCharset = L"ansi";

    // Hash algorithms may be: sha1, md2, md5, etc.
    const wchar_t *hashAlg = L"sha1";

    // Specify the SSID in hex:
    // For example, if the SSID is "ABC", then the 
    // hex values for these us-ascii chars is "414243"
    const wchar_t *ssidHex = L"414243";

    // The WPA key calculation will always use 4096 iterations.
    int iterationCount = 4096;

    // The WPA hex output should be 256 bits.
    int outputBitLen = 256;

    // Indicate that "hex" is to be returned.
    const wchar_t *enc = L"hex";

    wpaHexKey = crypt.pbkdf2(pw,pwCharset,hashAlg,ssidHex,iterationCount,outputBitLen,enc);

    wprintf(L"%s\n",wpaHexKey);
    }

 

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