当前位置:首页 » 存储配置 » sqlserver存储过程加密

sqlserver存储过程加密

发布时间: 2023-06-05 03:58:49

Ⅰ c# sqlserver 数据加密解密

比较简单的做法是数据在存入数据库之前用c#进行加密,然后再存入数据库,读取数据之后,用相应的解密方法对数据进行解密。

但是,如果你一定要在存储过程中加密的话,可以使用c#创建好对应的加密解密方法,然后生成一个加解密的类库dll,在sqlserver中引入该dll中的加密方法进行加密(Sqlserver调用dll的方法sqlserver调用dll),程序中可以直接调用该dll中的解密方法,也可以把解密方法直接写在程序中。

Ⅱ 怎么破解sqlserver加密的存储过程

在另外一台电脑上装数据库,然后将加密所在存储的数据库恢复上去即可。

Ⅲ 道与魔:SqlServer存储过程/函数加/解密

存储过程 存储函数的加密 WITH ENCRYPTION<! [if !supportLineBreakNewLine] ><! [endif] >CREATE procere dbo sp_XML_main@table_name nvarchar( )= @dirname nvarchar( )= WITH ENCRYPTIONasbegin endgo存储过程 存储函数的解密(以下是一位绝世高人编写的代码)if exists (select * from dbo sysobjects where id = object_id(N [dbo] [sp_decrypt] ) and OBJECTPROPERTY(id N IsProcere ) = )drop procere [dbo] [sp_decrypt]GO/* 破解函谈氏消数 过程 触发器 视图 仅限于SQLSERVER 作者:J All rights reserved*//* 调用示例 解密指定存储过程exec sp_decrypt AppSP_test 对所有的存储过程解密declare tb cursor forselect name from sysobjects where xtype= P and status> and name<> sp_decrypt declare @name sysnameopen tbfetch next from tb into @namewhile @@fetch_status= beginprint /* 存储过程 [ +@name+ ] */ exec sp_decrypt @namefetch next from tb into @nameendclose tbdeallocate tb */if exists (select * from dbo sysobjects where id = object_id(N [dbo] [SP_DECRYPT] ) and OBJECTPROPERTY(id N IsProcere ) = )drop procere [dbo] [SP_DECRYPT]GOCREATE PROCEDURE sp_decrypt(@objectName varchar( ))ASbeginset nocount on 破解字节不受限制 适用于SQLSERVER 存储过程 函数 视图 触发器 修正上一版视图触发器不能正确解密错误 发现有错 请E_MAIL begin trandeclare @objectname varchar( ) @varbin varbinary( )declare @sql nvarchar( ) @sql varchar( ) @sql nvarchar( ) @sql nvarchar( )DECLARE @OrigSpText nvarchar( ) @OrigSpText nvarchar( ) @OrigSpText nvarchar( ) @resultsp nvarchar( )declare @i int @status int @type varchar( ) @parentid intdeclare @colid int @n int @q int @j int @k int @encrypted int @number int核锋select @type=xtype @parentid=parent_obj from sysobjects where id=object_id(@ObjectName)含知create table #temp(number int colid int ctext varbinary( ) encrypted int status int)insert #temp SELECT number colid ctext encrypted status FROM sy *** ents WHERE id = object_id(@objectName)select @number=max(number) from #tempset @k= while @k<=@numberbeginif exists(select from sy *** ents where id=object_id(@objectname) and number=@k)beginif @type= P set @sql =(case when @number> then ALTER PROCEDURE + @objectName + ; +rtrim(@k)+ WITH ENCRYPTION AS else ALTER PROCEDURE + @objectName+ WITH ENCRYPTION AS end)if @type= TR begindeclare @parent_obj varchar( ) @tr_parent_xtype varchar( )select @parent_obj=parent_obj from sysobjects where id=object_id(@objectName)select @tr_parent_xtype=xtype from sysobjects where id=@parent_objif @tr_parent_xtype= V beginset @sql = ALTER TRIGGER +@objectname+ ON +OBJECT_NAME(@parentid)+ WITH ENCRYPTION INSTERD OF INSERT AS PRINT endelsebeginset @sql = ALTER TRIGGER +@objectname+ ON +OBJECT_NAME(@parentid)+ WITH ENCRYPTION FOR INSERT AS PRINT endendif @type= FN or @type= TF or @type= IF set @sql =(case @type when TF then ALTER FUNCTION + @objectName+ (@a char( )) returns @b table(a varchar( )) with encryption as begin insert @b select @a return end when FN then ALTER FUNCTION + @objectName+ (@a char( )) returns char( ) with encryption as begin return @a end when IF then ALTER FUNCTION + @objectName+ (@a char( )) returns table with encryption as return select @a as a end)if @type= V set @sql = ALTER VIEW +@objectname+ WITH ENCRYPTION AS SELECT as f set @q=len(@sql )set @sql =@sql +REPLICATE( @q)select @sql =REPLICATE( )set @sql = exec(@sql select @colid=max(colid) from #temp where number=@kset @n= while @n<=CEILING( *(@colid )/ ) and len(@sQL )<= beginset @sql =@sql + +@ set @n=@n+ endset @sql =@sql + ) exec sp_executesql @sql N @sql nvarchar( ) @ varchar( ) @sql =@sql @=@sql endset @k=@k+ endset @k= while @k<=@numberbeginif exists(select from sy *** ents where id=object_id(@objectname) and number=@k)beginselect @colid=max(colid) from #temp where number=@kset @n= while @n<=@colidbeginselect @OrigSpText =ctext @encrypted=encrypted @status=status FROM #temp WHERE colid=@n and number=@kSET @OrigSpText =(SELECT ctext FROM sy *** ents WHERE id=object_id(@objectName) and colid=@n and number=@k)if @n= beginif @type= P SET @OrigSpText =(case when @number> then CREATE PROCEDURE + @objectName + ; +rtrim(@k)+ WITH ENCRYPTION AS else CREATE PROCEDURE + @objectName + WITH ENCRYPTION AS end)if @type= FN or @type= TF or @type= IF SET @OrigSpText =(case @type when TF then CREATE FUNCTION + @objectName+ (@a char( )) returns @b table(a varchar( )) with encryption as begin insert @b select @a return end when FN then CREATE FUNCTION + @objectName+ (@a char( )) returns char( ) with encryption as begin return @a end when IF then CREATE FUNCTION + @objectName+ (@a char( )) returns table with encryption as return select @a as a end)if @type= TR beginif @tr_parent_xtype= V beginset @OrigSpText = CREATE TRIGGER +@objectname+ ON +OBJECT_NAME(@parentid)+ WITH ENCRYPTION INSTEAD OF INSERT AS PRINT endelsebeginset @OrigSpText = CREATE TRIGGER +@objectname+ ON +OBJECT_NAME(@parentid)+ WITH ENCRYPTION FOR INSERT AS PRINT endendif @type= V set @OrigSpText = CREATE VIEW +@objectname+ WITH ENCRYPTION AS SELECT as f set @q= len(@OrigSpText )set @OrigSpText =@OrigSpText +REPLICATE( @q)endelsebeginSET @OrigSpText =REPLICATE( )endSET @i= SET @resultsp = replicate(N A (datalength(@OrigSpText ) / ))WHILE @i<=datalength(@OrigSpText )/ BEGINSET @resultsp = stuff(@resultsp @i NCHAR(UNICODE(substring(@OrigSpText @i )) ^ lishixin/Article/program/SQLServer/201311/21965

Ⅳ SQLSERVER存储过程加密后,是不是任意版本都可以很容易解密

是的到目前为止,SQL Server所有版本的存储过程的加密的机理都是一样的,都可以被非常容易的破解,前提是,有读取存储过程的代码的权。
要防止用户得到SQL Server存储过程的真实代码,最简单的做法就是只给执行权,不给查看权。
至于安装在别人服务器上的SQL Server数据库中的存储过程,想不让别人看,那基本上是没门儿的。

Ⅳ sqlserver 中怎么样给现有的数据库加密。就是不想把自己数据库的存储过程等信息给其他人看到。

你把你的数据库修改登录时只能用用户名和密码登录,不允许windows登录,然后为他创建一个用户,这个用户赋予的权限你自己选,你想让他看什么就给他权限。不想就别给他赋权限即可。

热点内容
台式机忘记开机密码怎么办 发布:2025-02-06 11:58:01 浏览:868
android刷新按钮 发布:2025-02-06 11:57:17 浏览:585
存储过程有输入参数和输出参数 发布:2025-02-06 11:55:32 浏览:96
成绩评选算法 发布:2025-02-06 11:42:51 浏览:994
数据库测试数据 发布:2025-02-06 11:31:05 浏览:821
球头轴编程 发布:2025-02-06 11:29:36 浏览:280
为什么安卓系统不能收缩权限 发布:2025-02-06 11:27:58 浏览:730
算法4视频 发布:2025-02-06 11:19:20 浏览:934
51内置声卡需要什么主机配置 发布:2025-02-06 11:18:33 浏览:838
防针刺伤的物品配置有哪些 发布:2025-02-06 11:11:25 浏览:670