# Encrypting and Decrypting with IDEA

### This article shows how to encrypt and decrypt data using the IDEA component of IPWorks Encrypt.

Date Entered: 11/12/2014    Last Updated: 11/12/2014

IPWorks Encrypt makes it very easy to encrypt and decrypt data. This article will detail the process of performing IDEA encryption and decryption.

### IDEA Encryption

IDEA Encryption is as simple as selecting a KeyPassword and specifying the data to be encrypted. Please see the following example:

 Idea idea = new Idea(); idea.KeyPassword = "MyKeyPassword"; idea.InputFile = "C:\\Path\\to\\UnEncryptedFile.txt"; idea.OutputFile = "C:\\Path\\to\\EncryptedFile.dat"; idea.Encrypt(); 

### IDEA Decryption

IDEA Decryption is just as simple as IDEA Encryption. All that is needed is the encrypted data and the KeyPassword that was used during the encryption.

 Idea idea = new Idea(); idea.KeyPassword = "MyKeyPassword"; idea.InputFile = "C:\\Path\\to\\EncryptedFile.dat"; idea.OutputFile = "C:\\Path\\to\\DecryptedFile.txt"; idea.Decrypt(); 

### Configuring IDEA to use Hex-encoded strings

The IDEA component can be instructed to use Hex-encoded strings for its encryption and decryption operations. When the UseHex property is set to true, the Encrypt operation will Hex-encode the encrypted data. Similarly, if the UseHex property is set to true, the Decrypt operation will assume that the encrypted data has been Hex-encoded.