SQL Server/T-SQL Tutorial/System Functions/DecryptByPassphrase — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 13:46, 26 мая 2010
DecryptByPassphrase function
3> CREATE TABLE ForEncDemo (
4> rowid int IDENTITY(1,1) PRIMARY KEY,
5> name nvarChar(20),
6> id_data_orig Nvarchar(11),
7> id_data_enc varbinary(70)
8> )
9> GO
1>
2>
3> DECLARE @pp_value nvarchar(10);
4> SET @pp_value = "passphrase";
5>
6> SELECT id_data_orig, id_data_enc AS "Encrypted data",
7> CONVERT(nvarchar, DecryptByPassphrase(@pp_value, id_data_enc,
8> 1,
9> CONVERT(varbinary, rowid))) AS "Decrypted data"
10> FROM ForEncDemo
11> WHERE rowid = 1;
12> GO
id_data_orig Encrypted data
Decrypted data
------------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------- ------------------------------
(0 rows affected)
1> drop table ForEncDemo;
2> GO
1>