Xceed Encryption Library Documentation
Memory Encrypt Sample Application for Visual C++ with MFC
Samples > Memory Encrypt Sample Application for Visual C++ with MFC

Introduction

This sample demonstrates how to encrypt and decrypt a block of memory data using different kinds of encryption methods.

Project path

Project path: SAMPLES\VISUAL C++ 6-7\MEMORYENCRYPT

Project file name: MEMORYENCRYPT.DSP

Demonstrates

Properties: HashingMethod, EncryptionMode, PaddingMethod, EncryptionMethod, PrivateKey and PublicKey.

Methods: Encrypt, Decrypt, SetSecretKeyFromPassPhrase and SetRandomInitVector

How to use

Select the encryption method using one of the two radio buttons, Symmetric or Asymmetric (for public-key encryption ).

The Symmetric encryption uses the text you specify in the Pass phrase text box to create the secret key. You can click the "Option" button to set the encryption format (Rijndael or Twofish), the encryption mode, the key size, the hashing method and the padding method.

The Asymmetric encryption uses the file name you specify in the two text boxes and read from them the private key and the public key. You can create a new key pair by clicking the "Set random key pair" button. A form will pop-up where you will be able to enter the wanted key pair size (in bits). By default, a value of 1024 is provided. You can also specify a seed text which the random generator will use when creating the key pair. The private and the public key will be saved in the files entered in the main form.