Navigation:  thinBasic Modules > Crypto >

Crypto_Encrypt

Previous pageReturn to chapter overviewNext page

 

Description

 

Encrypts data with a designated algorithm.

 

Syntax

 

s = Crypto_Encrypt(sText, sPassword, nAlgorithm)

 

Returns

 

String

The encrypted data.

 

Parameters

 

Name

Type

Optional

Meaning

sText

String

No

text to be encrypted

sPassword

String

No

password for encrypting data.

nAlgorithm

Numeric

No

The cryptographic algorithm to be used.

It can be one of the following:

%Crypto_CALG_RC2

%Crypto_CALG_RC4

%Crypto_CALG_DES

 

Remarks

 

This functions is based on Microsoft's PROV_RSA_FULL Cryptographic Service Provider Type.

 

Restrictions

 

See also

 

Crypto_Decrypt

 

Examples

 

Dim sTxt As String

 

sTxt = Crypto_Encrypt("Hello world again!""The secret key"%Crypto_CALG_RC2)

MSGBOX 0, Crypto_Decrypt(sTxt, "The secret key"%Crypto_CALG_RC2

' results: Hello world again!

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com