Home    XP_CRYPT Online Help Prev Next
How To use XP_CRYPT GUI
Introduction
What is XP_CRYPT
System requirements
Free version limitations
End user license agreement
Installing XP_CRYPT
Installation procedure
Activation
XP_CRYPT API
What's new
Encryption methods overview
Session
xp_crypt_set_var
xp_crypt_get_var
xp_crypt_close_session
xp_crypt_init_session
xp_crypt_set_option
Asymmetric keys
DSA
xp_dsa_free_key
xp_dsa_load_key
xp_dsa_save_key
xp_dsa_generate_couple
RSA
xp_rsa_generate_couple
xp_rsa_generate_pub_key
xp_rsa_load_key
xp_rsa_priv_dec
xp_rsa_pub_enc
xp_rsa_save_key
xp_rsa_free_key
Digital signatures
DSA
xp_dsa_verify
xp_dsa_sign
RSA
xp_rsa_sign
xp_rsa_verify
Hashing
xp_crypt
xp_md5
xp_sha1
Symmetric encryption
AES128
xp_aes128_decrypt
xp_aes128_encrypt
AES
xp_aes_decrypt
xp_aes_encrypt
DESX
xp_desx_decrypt
xp_desx_encrypt
RC4
xp_rc4_decrypt
xp_rc4_encrypt
Triple DES
xp_des3_encrypt
xp_des3_decrypt
Error codes
Tutorial
How to use GUI
Advanced technique (Old)
Table encryption (Old)
Troubleshooting
Troubleshooting overview

xp_rsa_generate_couple

The function generates your private key with the key length. The free version uses the fixed key size - 256 bits. The password should be 4 or more chars. After successful execution @PrivateKey variable includes a private key which is used for decryption or later for public key generation. @PublicKey variable includes the public key used for data encryption. It is a good idea to save both keys now - @PrivateKey with a password and @PublicKey - without one. In the environment of quickly growing technical progress the key length which is less than 1024 bits should be considered unsecure. 

Syntax

xp_rsa_generate_couple { key size, private_key OUTPUT, pubilc_key OUTPUT }

Arguments

key size

VARCHAR. Size (in bits) of RSA key to be generated. Free version supports only '256'.

private_key

VARCHAR. On success, this variable holds the newly generated private key 

pubilc_key

VARCHAR. On success, this variable holds the newly generated private key 

Permissions

Execute permissions for xp_rsa_generate_couple default to members of the db_owner fixed database role in the master database, but can be granted to other users.

Return Code Values

0 - success, or Error code if failed. private_key IS NOT NULL (success) or IS NULL (failure) 

Example

declare @PrivateKey varchar (20)
declare @PublicKey varchar (20)
-- Creates Private key of 1024 bit length and returns key handles
exec xp_rsa_generate_couple '1024' , @PrivateKey output, @PublicKey output

 
2004-2011 (c) Active Crypt Software. All rights reserved.

Browser Based Help. Published by chm2web software.