sitio web php cómo usar el dongle
lt;
Const privada BITS_TO_A_BYTE = 8
Const privada BYTES_TO_A_WORD = 4
Const privada BITS_TO_A_WORD = 32
Privado m_lOnBits(30)
Privado m_l2Power(30)
Función privada LShift(lValue, iShiftBits)
Si iShiftBits = 0 Entonces
LShift = lValue
Salir de la función
ElseIf iShiftBits = 31 Entonces
Si lValue y 1 entonces
LShift = amp;H80000000
Else
LShift = 0
Finalizar si
Salir de la función
ElseIf iShiftBits lt; 0 O iShiftBits lt; 31 Entonces
Err If (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits 1) )))* m_l2Power(iShiftBits)) o amp; H80000000
De lo contrario
LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))* m_l2Power( iShiftBits))
Finalizar si
Finalizar función
Función privada RShift(lValue, iShiftBits)
Si iShiftBits = 0 Entonces p> p>
RShift = lValue
Salir de la función
ElseIf iShiftBits = 31 Entonces
Si lValue y amp;H80000000 Entonces
RShift = 1
Else
RShift = 0
Finalizar si
Salir de la función
ElseIf iShiftBits lt; 0 O iShiftBits gt; 31 Entonces
Err.Raise 6
Fin
RShift = (lValue And amp; H7FFFFFFE) \ m_l2Power(iShiftBits) p>
Si (lValue Y amp; H80000000) Entonces
RShift = (
RShift Or (amp.H80000000)\m_l2Power(iShiftBits)
Err; H40000000\m_l2Power(iShiftBits - 1)))
Finalizar si
Finalizar función
Función privada RotateLeft(lValue, iShiftBits)
RotateLeft = LShift(lValue, iShiftBits) o RShift(lValue, (32 - iShiftBits))
Función final
Función privada AddUnsigned(lX, lY)
Dim lX4
Dim lY4
Dim lX8
Dim lY8
Dim lResult
lX8 = lX Y amp; H80000000
lY8 = lY Y amp; amp H40000000
lY8 = lX Y amp.H40000000
LX4 = lX Y amp.H40000000H40000000
lY4 = lY amp. H40000000
lResult = ( lX Y amp; H3FFFFFFF) (lY Y amp; H3FFFFFFF)
Si lX4 Y lY4 Entonces
lResult = lResultado Xor amp ; H80000000 Xor lX8 Xor lY8
ElseIf lX4 o lY4 Entonces
Si lResult y amp H40000000 Entonces
lResult = lResult Xor amp;
De lo contrario
p>lResultado = lResultado Xor amp
De lo contrario
lResultado = lResultado Xor lX8 Xor lY8
Finalizar si
Else
lResultado = lResultado Xor lX8 Xor lY8
Finalizar si
AddUnsigned = lResultado
Función final
Función privada md5_F(x, y, z)
md5_F = (x e y) o ((no x) y z)
Función final
Función privada md5_G(x, y, z)
md5_G = (x y z) o (y y (no z))
Función final
Función privada
n md5_H(x, y, z)
md5_H = (x Xor y Xor z)
Función final
Función privada md5_I(x, y, z )
md5_I = (y Xor (x Or (Not z)))
Función final
Private Sub md5_FF(a, b, c. D, x, s, ac)
.
d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(md5_F(b, c, d), x), ac))
a = RotateLeft (a, s)
a = AddUnsigned(a, b)
a = AddUnsigned(a, b)
End Sub
Private Sub md5_GG (a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(md5_G(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub
Private Sub md5_HH(a, b , c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned( AddUnsigned(md5_H(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub
Private Sub md5_II(a, b, c, d , x, s,
Sub privado md5_II(a, b, c, d, x, s, ac)
Sub privado md5_II(a, b, c, d, x , s, ac) ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(md5_I(b, c, d), x), ac))
a = RotateLeft( a, s)
a = AddUnsigned(a, b)
End Sub
Función privada ConvertToWordArray(sMessage)
Dim lMessageLength
Dim lNumberOfWords
Dim lWordArray()
Dim lBytePosition
Dim lByteCount
Dim lWordCount
Const MODULUS_BITS = 512
Const CONGRUENT_BITS = 448
lMessageLength = Len(sMessage)
lNumberOfWords = (((lMessageLength ((MODULUS_BITS - CONGRUENT_BITS )Bits de paridad) (bits a bytes))\ (modulus_bits \ bits_to_a_byte)) 1) * (MODULUS_BITS \ BITS_TO_A_WORD)
ReDim lWordArray(lNumberOfWords - 1)
lByt
ePosition = 0
lByteCount = 0
Hacer hasta lByteCount gt;= lMessageLength
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (lByteCount Mod BYTES_TO _A_WORD) * BITS_TO_A_BYTE
lWordArray(lWordCount) = lWordArray(lWordCount) O LShift(Asc(Mid(sMessage, lByteCount 1, 1)), lBytePosition)
lByteCount = lByteCount 1
Bucle
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition= ( lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE
lWordArray(lWordCount) = lWordArray (lWordCount) O LShift(amp;H80, lBytePosition)
lWordArray(lNumberOfWords - 2) = LShift(lMessageLength, 3)
lWordArray(lNumberOfWords - 1) = RShift(lMessageLength, 29)
ConvertToWordArray = lWordArray
Función final
Función privada WordToHex(lValue)
Dim lByte
Dim lCount
Para lCount = 0 a 3
lByte = RShift(lValue, lCount * BITS_TO_A_BYTE) y m_lOnBits(BITS_TO_A_BYTE - 1)
WordToHex = WordToHex amp ;Derecha("0") & Hex(lByte),2)
Siguiente
Función final
Función pública MD5(sMessage)
m_lOnBits(0) = CLng(1)
m_lOnBits(1) = CLng(3)
m_lOnBits(2) = CLng(7)
m_lOnBits(3) = CLng(15)
m_lOnBits(4) = CLng(31)
m_lOnBits(5) = CLng(63)
m_lOnBits ( 6) = CLng(127)
m_lOnBits(7) = CLng(255)
m_lOnBits(8) = CLng(511)
m
_lOnBits(9) = CLng(1023)
m_lOnBits(10) = CLng(2047)
m_lOnBits(11) = CLng(4095)
m_lOnBits( 12) = CLng(8191)
m_lOnBits(13) = CLng(16383)
m_lOnBits(14) = CLng(32767)
m_lOnBits(15) = CLng(65535)
m_lOnBits(16) = CLng(131071)
m_lOnBits(17) = CLng(262143)
m_lOnBits(18) = CLng (524287)
m_lOnBits(19) = CLng(1048575)
m_lOnBits(20) = CLng(2097151)
m_lOnBits(21) = CLng(4194303 )
m_lOnBits(22) = CLng(8388607)
m_lOnBits(23) = CLng(16777215)
m_lOnBits(24) = CLng(33554431)
m_lOnBits(25) = CLng(67108863)
m_ lOnBits(26) = CLng(134217727)
m_lOnBits(27) = CLng(268435455) p>
m_lOnBits(28) = CLng(536870911)
m_lOnBits(29) = CLng(1073741823)
m_lOnBits(30) = CLng(2147483647)
m_l2Power(0) = CLng(1)
m_l2Power(1) = CLng(2)
m_l2Power(2)= CLng(4) <
m_l2Power(3) = CLng(8)
m_l2Power(4) = CLng(16)
m_l2Power(5) = CLng(32)
m_l2Power(6) = CLng(64)
m_l2Power(7) = CLng(128)
m_l2Power(8) = CLng(256)
m_l2Power( 9) = CLng(512)
m_l2Power(10) = CLng(1024)
m_l2Power(11) = CLng(2048) <
m_l2Power(12 ) = CLng(4096)
m_l2Power(13) = CLng(8192)
m_l2Power(14) = CLng(16384)
m_l2Power(15) = CLng(32768)
<
m_l2Power(16) = CLng(65536)
m_l2Power(17) = CLng(
131072)
m_l2Power(18) = CLng(262144)
m_l2Power(19) = CLng(524288)
m_l2Power(20) = CLng(1048576)
m_l2Power(21) = CLng(2097152)
m_l2Power(22) = CLng(4194304)
md5_FF d, a, b, c, x( k 1), S12, amplificador; HE8C7B756
md5_FF c, d, a, b, x(k 2), S13, amplificador H242070DB
md5_FF b, c, d, a, x(k 3), S14, amp.HC1BDCEEE
md5_FF a, b, c, d, x(k 4), S11, amperio HF57C0FAF
md5_FF d, a, b, c, x(k 5), S12, amplificador H4787C62A
md5_FF c, d, a, b, x(k 6), amplificador; c, d, a, b, x(k 6), amplificador H4787C62A
md5_FF S13, amplificador HA8304613
md5_FF b, c, d, a, x(k 7) ), S14, amplificador HFD469501
md5_FF a, b, c, d, x(k 8), S11, amplificador H698098D8
md5_FF d, a, b, c, x(k 9), S12, amplificador H8B44F7AF
md5_FF c, d, a, b, x(k 10), S13, amplificador HFFFF5BB1
md5_FF b, c, d, a, x(k 11), S14, amplificador H895CD7BE
md5 _FF a, b, c, d, x(k 12), S11, amplificador; md5_FF d, a, b, c, x(k 13), S12, amplificador HFD987193
md5_FF c, d, a, b, x(k 14), S13, amplificador.HA679438E
md5_FF b, c, d, a, x(k 15), S14, amplificador H49B40821
md5_GG a, b, c, d, x(k 1), S21, amplificador; HF61E2562
md5_GG d, a, b, c, x(k 6), amperio HF61E2562
md5_GG d, a, b, c, x(k 6), amperio; HFD987193 S22 y HC040B340
md5_GG c, d, a, b, x(k 11), S23 y H265E5A51
md5_GG b, c, d, a, x (k 0), S24, un
mp;HE9B6C7AA
md5_GG a, b, c, d, x(k 5), S24, amp;HE9B6C7AA
md5_GG a, b, c, d, x(k 5 ) d, d, a, b, x (k + 15), S23, amperio H2441453
md5_GG c, d, a, b, x (k + 15), S23, amperio; /p>
md5 _GG b, c, d, a, x(k 4), S24, amplificador HE7D3FBC8
md5_GG a, b, c, d, x(k 9), S21 , amperio H21E1CDE6
md5_GG d, a, b, c, x(k 14), S22, amperio HC33707D6
md5_GG c, d, a, b , x(k 3), S23, amplificador HF4D50D87
md5_GG b, c, d, a, x (k 8), S24, amplificador
md5_GG a, b; , c, d, x ( k 13), S21, amperio.HA9E3E905
md5_GG d, a, b, c, x (k 2), S22, amperio HFCEFA3F8
md5_GG c, d, a, b, x(k 7), S23, amperio HFFFA3942
md5_HH d, a, b, c, x(k 8), S32, amperio; >
md5_HH c, d, a, b, x(k 11), S33, amp H6D9D6122
md5_HH b, c, d, a, x(k 14), S34, amp; HFDE5380C
md5_HH a, b, c, d, x(k 1), S31, amplificador HA4BEEA44
md5 _HH d, a, b, c, x(k 4) , S32, amperio H4BDECFA9
md5_HH c, d, a, b, x(k 7), S33, amperio H289B7EC6
md5_HH d, a, b, c, x (k 0), S32, amplificador HEAA127FA
md5_HH c, d, a, b, x(k 3), S33, amplificador
md5_HH c, d, a; , b, x(k 3) ), S33 y HEAA127FAHD4EF3085
md5_HH b, c, d, a, x(k 6), S34 y H4881D05
md5_HH a, b, c, d, x(k 9), S31, amplificador HD9D4D039
md5_HH d, a, b, c, x(k 12), amplificador;
A
md5_HH c, d, a, b, c, x(k 12), amplificador HEAA127FA S32, amplificador HE6DB99E5
md5_HH c, d, a, b, x (k 15), S33 y H1FA27CF8
md5_HH b, c, d, a, x(k 2), S34 y HC4AC5665
md5_II a, b, c , d, x(k 0), S34, amperio HC4AC5665
md5_II a, b, c, d, x(k 0) d, x(k 0), amperio; p>
md5_II d, a, b, c, x(k 7), S42, amp H432AFF97
md5_II c, d, a, b, x(k 14), S43, amp; ; HAB9423A7
md5_II b, c, d, a, x(k 5), S44, amplificador HFC93A039
md5_II a, b, c, d, x(k 12) , S41, amplificador HFC93A039
md5_II a, b, c, d, x (k 12), S41, amplificador HFC93A039H655B59C3
md5_II d, a, b, c, x; (k 3), S42, amplificador H8F0CCC92
md5_II c, d, a, b, x(k 10), S43, HFFEFF47D
md5_II b; , c, d, a, x(k 1), S44, amplificador H85845DD1
md5_II a, b, c, d, x(k 8), S41, amplificador.H6FA87E4F
md5_II d, a, b, c, x(k 15), S42, amperio HFE2CE6E0
md5_II c, d, a, b, x(k 6), amperio; /p>
md5_II b, c, d, a, x(k 13), S44, amplificador H4E0811A1
md5_II a, b, c, d, x(k 4), S41, amp HF7537E82
md5_II d, a, b, c, x(k 11), S42, amp HBD3AF235
Úselo al llamar
MD5 (requiere Contenido cifrado)
MD5 = LCase(WordToHex(a) amp; WordToHex(b) amp; WordToHex(c) amp.