Thursday, March 22, 2012

encryption

Why doesn't this work?
CREATE TABLE [dbo].[WebSecurity](
[WebSecurityID] [int] IDENTITY(1,1) NOT NULL,
[webIdentity] [varchar](50) NOT NULL,
[webPassword_encrypted] [varbinary](256) NULL)
delete from websecurity
insert into WebSecurity (WebIdentity,webpassword_encrypted)
values('vanwagenen\WebServer',EncryptByP
assPhrase ('myphrase','mypassword'))
select webidentity, decryptByPassPhrase
('myphrase',webpassword_encrypted)from webSecurity
--
Arne Garvander
Certified Geek
Professional Data DudeHello Arne,
It did, you just didn't get the answer you expected. Try:
select webidentity, cast(decryptByPassPhrase ('myphrase',webpassword_encrypt
ed)
as varchar(255)) from webSecurity
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/

No comments:

Post a Comment