World Servers
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

Habilitar//Desabilitar MD5

Ir abajo

Habilitar//Desabilitar MD5 Empty Habilitar//Desabilitar MD5

Mensaje por WassingtoN 2010-11-16, 06:45

MD5 es un tipo de encriptación de contraseñas, es decir si un user elige como contraseña 123456 no va a verse así, sino algo como "a385b5745c751d13876e1eff45722" (Es sólo una manera de decir)

Es básicamente usado para más seguridad, pero personalmente molesta bastante. Por eso acá dejo los Scripts tanto para Habilitar el MD5 como para deshabilitarlo.

Habilitar MD5:

Ponen estos códigos en orden, es decir, primero el A, después el B y así uno a uno en el analizador de consultas de SQL.

A:

USE master;
exec sp_addextendedproc 'XP_MD5_EncodeKeyVal', 'WZ_MD5_MOD.dll'



B:

use MuOnline;



C:

CREATE FUNCTION [dbo].[fn_md5] (@data VARCHAR(10), @data2 VARCHAR(10))
RETURNS BINARY(16) AS
BEGIN
DECLARE @hash BINARY(16)
EXEC master.dbo.XP_MD5_EncodeKeyVal @data, @data2, @hash OUT
RETURN @hash
END



D:

CREATE PROCEDURE Encript
@btInStr VARCHAR(10),
@
btInStrIndex VARCHAR(10)
AS
BEGIN
DECLARE @btOutVal BINARY(16)
EXEC master..XP_MD5_EncodeKeyVal @btInStr, @btInStrIndex, @btOutVal OUT
UPDATE MEMB_INFO SET memb__pwd
= @btOutVal WHERE memb___id = @btInStrIndex
END
GO



E:

CREATE PROCEDURE DencriptPW
@btInStr VARCHAR(10),
@
btInStrIndex VARCHAR(10)
AS
BEGIN
DECLARE @btOutVal BINARY(16)
EXEC master..XP_MD5_EncodeKeyVal @btInStr, @btInStrIndex, @btOutVal OUT
SELECT memb__pwd FROM MEMB_INFO WHERE memb__pwd
= @btOutVal AND memb___id = @btInStrIndex
END
GO



Y después de eso colocan la DLL que dejo adjunta en Binn en la carpeta de su SQL. (Normalmente es C:\Archivo de programas\Microsoft SQL Server\MSSQL\Binn)

Descargar

Con eso ya tienen su server con encriptación MD5.

---------------------------------------------------------------


Deshabilitar MD5

Ahora para Deshabilitar el MD5, hacemos lo siguiente.

Vamos nuevamente al analizador de consultas y esta vez ponemos:



if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MANG_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MANG_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MEMB_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MEMB_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MEMB_OUT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MEMB_OUT]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MembInfoModify]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MembInfoModify]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VI_CURR_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[VI_CURR_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VI_FQNW_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[VI_FQNW_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VI_MIDS_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[VI_MIDS_INFO]
GO

CREATE TABLE
[dbo].[MANG_INFO] (
[
mang_guid] [int] NOT NULL ,
[
mang___id] [nvarchar] (15) COLLATE Polish_CI_AS NOT NULL ,
[
mang__pwd] [nvarchar] (15) COLLATE Polish_CI_AS NOT NULL ,
[
mang_name] [nvarchar] (20) COLLATE Polish_CI_AS NOT NULL ,
[
mail_addr] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
levl_name] [nvarchar] (30) COLLATE Polish_CI_AS NULL ,
[
part_name] [nvarchar] (30) COLLATE Polish_CI_AS NULL ,
[
auth_code] [nvarchar] (30) COLLATE Polish_CI_AS NULL ,
[
appl_days] [nvarchar] (8) COLLATE Polish_CI_AS NOT NULL ,
[
ctl1_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
Group_code] [nvarchar] (2) COLLATE Polish_CI_AS NULL ,
[
dep_code] [nvarchar] (4) COLLATE Polish_CI_AS NOT NULL ,
[
perm] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[MEMB_INFO] (
[
memb_guid] [int] IDENTITY (1, 1) NOT NULL ,
[
memb___id] [varchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb__pwd] [varchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [varchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [char] (13) COLLATE Polish_CI_AS NOT NULL ,
[
post_code] [char] (6) COLLATE Polish_CI_AS NULL ,
[
addr_info] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
addr_deta] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
tel__numb] [varchar] (20) COLLATE Polish_CI_AS NULL ,
[
phon_numb] [varchar] (15) COLLATE Polish_CI_AS NULL ,
[
mail_addr] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_ques] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_answ] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
job__code] [char] (2) COLLATE Polish_CI_AS NULL ,
[
appl_days] [datetime] NULL ,
[
modi_days] [datetime] NULL ,
[
out__days] [datetime] NULL ,
[
true_days] [datetime] NULL ,
[
mail_chek] [char] (1) COLLATE Polish_CI_AS NULL ,
[
bloc_code] [char] (1) COLLATE Polish_CI_AS NOT NULL ,
[
ctl1_code] [char] (1) COLLATE Polish_CI_AS NOT NULL ,
[
adminaccess] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[MEMB_OUT] (
[
out__guid] [int] NOT NULL ,
[
memb_guid] [int] NOT NULL ,
[
sno__numb] [nvarchar] (7) COLLATE Polish_CI_AS NULL ,
[
memb_name] [nvarchar] (15) COLLATE Polish_CI_AS NULL ,
[
appl_days] [smalldatetime] NULL ,
[
ctl1_code] [nvarchar] (1) COLLATE Polish_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[MembInfoModify] (
[
Number] [int] NOT NULL ,
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb__pwd] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [nvarchar] (13) COLLATE Polish_CI_AS NOT NULL ,
[
tel__numb] [nvarchar] (20) COLLATE Polish_CI_AS NULL ,
[
phon_numb] [nvarchar] (15) COLLATE Polish_CI_AS NULL ,
[
mail_addr] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_ques] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_answ] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
bloc_code] [nvarchar] (1) COLLATE Polish_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[VI_CURR_INFO] (
[
ends_days] [nvarchar] (8) COLLATE Polish_CI_AS NULL ,
[
chek_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
used_time] [int] NULL ,
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_guid] [int] NOT NULL ,
[
sno__numb] [nvarchar] (18) COLLATE Polish_CI_AS NOT NULL ,
[
Bill_Section] [int] NULL ,
[
Bill_Value] [int] NULL ,
[
Bill_Hour] [int] NULL ,
[
Surplus_Point] [int] NULL ,
[
Surplus_Minute] [datetime] NULL ,
[
Increase_Days] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[VI_FQNW_INFO] (
[
appl_code] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
ctrl_text] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_ques] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
fpas_answ] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
appl_days] [nvarchar] (8) COLLATE Polish_CI_AS NOT NULL ,
[
ctl1_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_guid] [int] NOT NULL ,
[
fanw_guid] [int] NOT NULL ,
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [nvarchar] (18) COLLATE Polish_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[VI_MIDS_INFO] (
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [nvarchar] (18) COLLATE Polish_CI_AS NOT NULL ,
[
appl_days] [nvarchar] (8) COLLATE Polish_CI_AS NOT NULL ,
[
chek_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
prev_info] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
modi_info] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
cont_text] [ntext] COLLATE Polish_CI_AS NOT NULL ,
[
mids_guid] [int] NOT NULL ,
[
admin_name] [nvarchar] (10) COLLATE Polish_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE MEMB_INFO ALTER COLUMN memb__pwd VARCHAR
(10) NOT NULL
GO



Y luego vamos a la carpeta Binn de donde se instaló el SQL y eliminamos la DLL que mencionamos antes.

Sólo eso, ya tenés tu server SIN MD5.

NOTA: El paso de QUITAR MD5 debe hacerse con las DB limpias, de lo contrario pueden perder información valiosa
WassingtoN
WassingtoN
Level |V
Level |V

Usuario Activo Masculino Argentina No tienes ningun Trofeo Medalla de Plata : Nivel 2º No tienes ninguna Advertencia
~ New User ~
Mensajes : 439
Cash Point : 27964
Prestigio : -17
Registro : 10/11/2010
Localización : San Luis
Edad : 33

http://mu-afrodita.mi-foro.es/

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.