Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: nhaalclkiemr en 27 Julio 2007, 17:05 pm



Título: Se pueden generar hash con VB6.0
Publicado por: nhaalclkiemr en 27 Julio 2007, 17:05 pm
Me gustaría saber si es posible implementar un codigo que nos devuelva el MD5, o CRC de un archivo o palabra...ya se k en C si se puede pero me gustaría saber si se podría hacer en VB un generador de hashes...esto es para por ejemplo comprovar si un archivo ha llegado bien o para cifrar contraseñas por ejemplo...para eso ya sé que hay programas como md5sum pero me gustaría saber si se podría crear un codigo en VB6.0 que calcule los hashes, de forma k no haga falta ningun programa.

Saludos ;)


Título: Re: Se pueden generar hash con VB6.0
Publicado por: ActiveSheet en 27 Julio 2007, 18:57 pm
Claro y eso es un ejemplo de la Implementación del MD5


En Formulario

Código
  1. Dim md5Test As MD5
  2.  
  3.  
  4. Private Sub btnRunTest_Click()
  5.    lblResults(0).Caption = LCase(md5Test.DigestStrToHexStr(""))
  6.    lblResults(1).Caption = LCase(md5Test.DigestStrToHexStr("a"))
  7.    lblResults(2).Caption = LCase(md5Test.DigestStrToHexStr("abc"))
  8.    lblResults(3).Caption = LCase(md5Test.DigestStrToHexStr("message digest"))
  9.    lblResults(4).Caption = LCase(md5Test.DigestStrToHexStr("abcdefghijklmnopqrstuvwxyz"))
  10.    lblResults(5).Caption = LCase(md5Test.DigestStrToHexStr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))
  11.    lblResults(6).Caption = LCase(md5Test.DigestStrToHexStr("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))
  12. End Sub
  13.  
  14.  
  15. Private Sub Form_Load()
  16.    ' Instantiate our class
  17.    Set md5Test = New MD5
  18. End Sub
  19.  

en Modulo de clase

Código
  1. Private Const OFFSET_4 = 4294967296#
  2. Private Const MAXINT_4 = 2147483647
  3.  
  4. Private Const S11 = 7
  5. Private Const S12 = 12
  6. Private Const S13 = 17
  7. Private Const S14 = 22
  8. Private Const S21 = 5
  9. Private Const S22 = 9
  10. Private Const S23 = 14
  11. Private Const S24 = 20
  12. Private Const S31 = 4
  13. Private Const S32 = 11
  14. Private Const S33 = 16
  15. Private Const S34 = 23
  16. Private Const S41 = 6
  17. Private Const S42 = 10
  18. Private Const S43 = 15
  19. Private Const S44 = 21
  20.  
  21.  
  22. '=
  23. '= Class Variables
  24. '=
  25. Private State(4) As Long
  26. Private ByteCounter As Long
  27. Private ByteBuffer(63) As Byte
  28.  
  29.  
  30. '=
  31. '= Class Properties
  32. '=
  33. Property Get RegisterA() As String
  34.    RegisterA = State(1)
  35. End Property
  36.  
  37. Property Get RegisterB() As String
  38.    RegisterB = State(2)
  39. End Property
  40.  
  41. Property Get RegisterC() As String
  42.    RegisterC = State(3)
  43. End Property
  44.  
  45. Property Get RegisterD() As String
  46.    RegisterD = State(4)
  47. End Property
  48.  
  49.  
  50. '=
  51. '= Class Functions
  52. '=
  53.  
  54. '
  55. ' Function to quickly digest a file into a hex string
  56. '
  57. Public Function DigestFileToHexStr(FileName As String) As String
  58.    Open FileName For Binary Access Read As #1
  59.    MD5Init
  60.    Do While Not EOF(1)
  61.        Get #1, , ByteBuffer
  62.        If Loc(1) < LOF(1) Then
  63.            ByteCounter = ByteCounter + 64
  64.            MD5Transform ByteBuffer
  65.        End If
  66.    Loop
  67.    ByteCounter = ByteCounter + (LOF(1) Mod 64)
  68.    Close #1
  69.    MD5Final
  70.    DigestFileToHexStr = GetValues
  71. End Function
  72.  
  73. '
  74. ' Function to digest a text string and output the result as a string
  75. ' of hexadecimal characters.
  76. '
  77. Public Function DigestStrToHexStr(SourceString As String) As String
  78.    MD5Init
  79.    MD5Update Len(SourceString), StringToArray(SourceString)
  80.    MD5Final
  81.    DigestStrToHexStr = GetValues
  82. End Function
  83.  
  84. '
  85. ' A utility function which converts a string into an array of
  86. ' bytes.
  87. '
  88. Private Function StringToArray(InString As String) As Byte()
  89.    Dim I As Integer
  90.    Dim bytBuffer() As Byte
  91.    ReDim bytBuffer(Len(InString))
  92.    For I = 0 To Len(InString) - 1
  93.        bytBuffer(I) = Asc(Mid(InString, I + 1, 1))
  94.    Next I
  95.    StringToArray = bytBuffer
  96. End Function
  97.  
  98. '
  99. ' Concatenate the four state vaules into one string
  100. '
  101. Public Function GetValues() As String
  102.    GetValues = LongToString(State(1)) & LongToString(State(2)) & LongToString(State(3)) & LongToString(State(4))
  103. End Function
  104.  
  105. '
  106. ' Convert a Long to a Hex string
  107. '
  108. Private Function LongToString(Num As Long) As String
  109.        Dim a As Byte
  110.        Dim b As Byte
  111.        Dim c As Byte
  112.        Dim d As Byte
  113.  
  114.        a = Num And &HFF&
  115.        If a < 16 Then
  116.            LongToString = "0" & Hex(a)
  117.        Else
  118.            LongToString = Hex(a)
  119.        End If
  120.  
  121.        b = (Num And &HFF00&) \ 256
  122.        If b < 16 Then
  123.            LongToString = LongToString & "0" & Hex(b)
  124.        Else
  125.            LongToString = LongToString & Hex(b)
  126.        End If
  127.  
  128.        c = (Num And &HFF0000) \ 65536
  129.        If c < 16 Then
  130.            LongToString = LongToString & "0" & Hex(c)
  131.        Else
  132.            LongToString = LongToString & Hex(c)
  133.        End If
  134.  
  135.        If Num < 0 Then
  136.            d = ((Num And &H7F000000) \ 16777216) Or &H80&
  137.        Else
  138.            d = (Num And &HFF000000) \ 16777216
  139.        End If
  140.  
  141.        If d < 16 Then
  142.            LongToString = LongToString & "0" & Hex(d)
  143.        Else
  144.            LongToString = LongToString & Hex(d)
  145.        End If
  146.  
  147. End Function
  148.  
  149. '
  150. ' Initialize the class
  151. '   This must be called before a digest calculation is started
  152. '
  153. Public Sub MD5Init()
  154.    ByteCounter = 0
  155.    State(1) = UnsignedToLong(1732584193#)
  156.    State(2) = UnsignedToLong(4023233417#)
  157.    State(3) = UnsignedToLong(2562383102#)
  158.    State(4) = UnsignedToLong(271733878#)
  159. End Sub
  160.  
  161. '
  162. ' MD5 Final
  163. '
  164. Public Sub MD5Final()
  165.    Dim dblBits As Double
  166.  
  167.    Dim padding(72) As Byte
  168.    Dim lngBytesBuffered As Long
  169.  
  170.    padding(0) = &H80
  171.  
  172.    dblBits = ByteCounter * 8
  173.  
  174.    ' Pad out
  175.    lngBytesBuffered = ByteCounter Mod 64
  176.    If lngBytesBuffered <= 56 Then
  177.        MD5Update 56 - lngBytesBuffered, padding
  178.    Else
  179.        MD5Update 120 - ByteCounter, padding
  180.    End If
  181.  
  182.  
  183.    padding(0) = UnsignedToLong(dblBits) And &HFF&
  184.    padding(1) = UnsignedToLong(dblBits) \ 256 And &HFF&
  185.    padding(2) = UnsignedToLong(dblBits) \ 65536 And &HFF&
  186.    padding(3) = UnsignedToLong(dblBits) \ 16777216 And &HFF&
  187.    padding(4) = 0
  188.    padding(5) = 0
  189.    padding(6) = 0
  190.    padding(7) = 0
  191.  
  192.    MD5Update 8, padding
  193. End Sub
  194.  
  195. '
  196. ' Break up input stream into 64 byte chunks
  197. '
  198. Public Sub MD5Update(InputLen As Long, InputBuffer() As Byte)
  199.    Dim II As Integer
  200.    Dim I As Integer
  201.    Dim J As Integer
  202.    Dim K As Integer
  203.    Dim lngBufferedBytes As Long
  204.    Dim lngBufferRemaining As Long
  205.    Dim lngRem As Long
  206.  
  207.    lngBufferedBytes = ByteCounter Mod 64
  208.    lngBufferRemaining = 64 - lngBufferedBytes
  209.    ByteCounter = ByteCounter + InputLen
  210.    ' Use up old buffer results first
  211.    If InputLen >= lngBufferRemaining Then
  212.        For II = 0 To lngBufferRemaining - 1
  213.            ByteBuffer(lngBufferedBytes + II) = InputBuffer(II)
  214.        Next II
  215.        MD5Transform ByteBuffer
  216.  
  217.        lngRem = (InputLen) Mod 64
  218.        ' The transfer is a multiple of 64 lets do some transformations
  219.        For I = lngBufferRemaining To InputLen - II - lngRem Step 64
  220.            For J = 0 To 63
  221.                ByteBuffer(J) = InputBuffer(I + J)
  222.            Next J
  223.            MD5Transform ByteBuffer
  224.        Next I
  225.        lngBufferedBytes = 0
  226.    Else
  227.      I = 0
  228.    End If
  229.  
  230.    ' Buffer any remaining input
  231.    For K = 0 To InputLen - I - 1
  232.        ByteBuffer(lngBufferedBytes + K) = InputBuffer(I + K)
  233.    Next K
  234.  
  235. End Sub
  236.  
  237. '
  238. ' MD5 Transform
  239. '
  240. Private Sub MD5Transform(Buffer() As Byte)
  241.    Dim x(16) As Long
  242.    Dim a As Long
  243.    Dim b As Long
  244.    Dim c As Long
  245.    Dim d As Long
  246.  
  247.    a = State(1)
  248.    b = State(2)
  249.    c = State(3)
  250.    d = State(4)
  251.  
  252.    Decode 64, x, Buffer
  253.  
  254.    ' Round 1
  255.    FF a, b, c, d, x(0), S11, -680876936
  256.    FF d, a, b, c, x(1), S12, -389564586
  257.    FF c, d, a, b, x(2), S13, 606105819
  258.    FF b, c, d, a, x(3), S14, -1044525330
  259.    FF a, b, c, d, x(4), S11, -176418897
  260.    FF d, a, b, c, x(5), S12, 1200080426
  261.    FF c, d, a, b, x(6), S13, -1473231341
  262.    FF b, c, d, a, x(7), S14, -45705983
  263.    FF a, b, c, d, x(8), S11, 1770035416
  264.    FF d, a, b, c, x(9), S12, -1958414417
  265.    FF c, d, a, b, x(10), S13, -42063
  266.    FF b, c, d, a, x(11), S14, -1990404162
  267.    FF a, b, c, d, x(12), S11, 1804603682
  268.    FF d, a, b, c, x(13), S12, -40341101
  269.    FF c, d, a, b, x(14), S13, -1502002290
  270.    FF b, c, d, a, x(15), S14, 1236535329
  271.  
  272.    ' Round 2
  273.    GG a, b, c, d, x(1), S21, -165796510
  274.    GG d, a, b, c, x(6), S22, -1069501632
  275.    GG c, d, a, b, x(11), S23, 643717713
  276.    GG b, c, d, a, x(0), S24, -373897302
  277.    GG a, b, c, d, x(5), S21, -701558691
  278.    GG d, a, b, c, x(10), S22, 38016083
  279.    GG c, d, a, b, x(15), S23, -660478335
  280.    GG b, c, d, a, x(4), S24, -405537848
  281.    GG a, b, c, d, x(9), S21, 568446438
  282.    GG d, a, b, c, x(14), S22, -1019803690
  283.    GG c, d, a, b, x(3), S23, -187363961
  284.    GG b, c, d, a, x(8), S24, 1163531501
  285.    GG a, b, c, d, x(13), S21, -1444681467
  286.    GG d, a, b, c, x(2), S22, -51403784
  287.    GG c, d, a, b, x(7), S23, 1735328473
  288.    GG b, c, d, a, x(12), S24, -1926607734
  289.  
  290.    ' Round 3
  291.    HH a, b, c, d, x(5), S31, -378558
  292.    HH d, a, b, c, x(8), S32, -2022574463
  293.    HH c, d, a, b, x(11), S33, 1839030562
  294.    HH b, c, d, a, x(14), S34, -35309556
  295.    HH a, b, c, d, x(1), S31, -1530992060
  296.    HH d, a, b, c, x(4), S32, 1272893353
  297.    HH c, d, a, b, x(7), S33, -155497632
  298.    HH b, c, d, a, x(10), S34, -1094730640
  299.    HH a, b, c, d, x(13), S31, 681279174
  300.    HH d, a, b, c, x(0), S32, -358537222
  301.    HH c, d, a, b, x(3), S33, -722521979
  302.    HH b, c, d, a, x(6), S34, 76029189
  303.    HH a, b, c, d, x(9), S31, -640364487
  304.    HH d, a, b, c, x(12), S32, -421815835
  305.    HH c, d, a, b, x(15), S33, 530742520
  306.    HH b, c, d, a, x(2), S34, -995338651
  307.  
  308.    ' Round 4
  309.    II a, b, c, d, x(0), S41, -198630844
  310.    II d, a, b, c, x(7), S42, 1126891415
  311.    II c, d, a, b, x(14), S43, -1416354905
  312.    II b, c, d, a, x(5), S44, -57434055
  313.    II a, b, c, d, x(12), S41, 1700485571
  314.    II d, a, b, c, x(3), S42, -1894986606
  315.    II c, d, a, b, x(10), S43, -1051523
  316.    II b, c, d, a, x(1), S44, -2054922799
  317.    II a, b, c, d, x(8), S41, 1873313359
  318.    II d, a, b, c, x(15), S42, -30611744
  319.    II c, d, a, b, x(6), S43, -1560198380
  320.    II b, c, d, a, x(13), S44, 1309151649
  321.    II a, b, c, d, x(4), S41, -145523070
  322.    II d, a, b, c, x(11), S42, -1120210379
  323.    II c, d, a, b, x(2), S43, 718787259
  324.    II b, c, d, a, x(9), S44, -343485551
  325.  
  326.  
  327.    State(1) = LongOverflowAdd(State(1), a)
  328.    State(2) = LongOverflowAdd(State(2), b)
  329.    State(3) = LongOverflowAdd(State(3), c)
  330.    State(4) = LongOverflowAdd(State(4), d)
  331.  
  332. '  /* Zeroize sensitive information.
  333. '*/
  334. '  MD5_memset ((POINTER)x, 0, sizeof (x));
  335.  
  336. End Sub
  337.  
  338. Private Sub Decode(Length As Integer, OutputBuffer() As Long, InputBuffer() As Byte)
  339.    Dim intDblIndex As Integer
  340.    Dim intByteIndex As Integer
  341.    Dim dblSum As Double
  342.  
  343.    intDblIndex = 0
  344.    For intByteIndex = 0 To Length - 1 Step 4
  345.        dblSum = InputBuffer(intByteIndex) + _
  346.                                    InputBuffer(intByteIndex + 1) * 256# + _
  347.                                    InputBuffer(intByteIndex + 2) * 65536# + _
  348.                                    InputBuffer(intByteIndex + 3) * 16777216#
  349.        OutputBuffer(intDblIndex) = UnsignedToLong(dblSum)
  350.        intDblIndex = intDblIndex + 1
  351.    Next intByteIndex
  352. End Sub
  353.  
  354. '
  355. ' FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
  356. ' Rotation is separate from addition to prevent recomputation.
  357. '
  358. Private Function FF(a As Long, _
  359.                    b As Long, _
  360.                    c As Long, _
  361.                    d As Long, _
  362.                    x As Long, _
  363.                    s As Long, _
  364.                    ac As Long) As Long
  365.    a = LongOverflowAdd4(a, (b And c) Or (Not (b) And d), x, ac)
  366.    a = LongLeftRotate(a, s)
  367.    a = LongOverflowAdd(a, b)
  368. End Function
  369.  
  370. Private Function GG(a As Long, _
  371.                    b As Long, _
  372.                    c As Long, _
  373.                    d As Long, _
  374.                    x As Long, _
  375.                    s As Long, _
  376.                    ac As Long) As Long
  377.    a = LongOverflowAdd4(a, (b And d) Or (c And Not (d)), x, ac)
  378.    a = LongLeftRotate(a, s)
  379.    a = LongOverflowAdd(a, b)
  380. End Function
  381.  
  382. Private Function HH(a As Long, _
  383.                    b As Long, _
  384.                    c As Long, _
  385.                    d As Long, _
  386.                    x As Long, _
  387.                    s As Long, _
  388.                    ac As Long) As Long
  389.    a = LongOverflowAdd4(a, b Xor c Xor d, x, ac)
  390.    a = LongLeftRotate(a, s)
  391.    a = LongOverflowAdd(a, b)
  392. End Function
  393.  
  394. Private Function II(a As Long, _
  395.                    b As Long, _
  396.                    c As Long, _
  397.                    d As Long, _
  398.                    x As Long, _
  399.                    s As Long, _
  400.                    ac As Long) As Long
  401.    a = LongOverflowAdd4(a, c Xor (b Or Not (d)), x, ac)
  402.    a = LongLeftRotate(a, s)
  403.    a = LongOverflowAdd(a, b)
  404. End Function
  405.  
  406. '
  407. ' Rotate a long to the right
  408. '
  409. Function LongLeftRotate(value As Long, bits As Long) As Long
  410.    Dim lngSign As Long
  411.    Dim lngI As Long
  412.    bits = bits Mod 32
  413.    If bits = 0 Then LongLeftRotate = value: Exit Function
  414.    For lngI = 1 To bits
  415.        lngSign = value And &HC0000000
  416.        value = (value And &H3FFFFFFF) * 2
  417.        value = value Or ((lngSign < 0) And 1) Or (CBool(lngSign And _
  418.                &H40000000) And &H80000000)
  419.    Next
  420.    LongLeftRotate = value
  421. End Function
  422.  
  423. '
  424. ' Function to add two unsigned numbers together as in C.
  425. ' Overflows are ignored!
  426. '
  427. Private Function LongOverflowAdd(Val1 As Long, Val2 As Long) As Long
  428.    Dim lngHighWord As Long
  429.    Dim lngLowWord As Long
  430.    Dim lngOverflow As Long
  431.  
  432.    lngLowWord = (Val1 And &HFFFF&) + (Val2 And &HFFFF&)
  433.    lngOverflow = lngLowWord \ 65536
  434.    lngHighWord = (((Val1 And &HFFFF0000) \ 65536) + ((Val2 And &HFFFF0000) \ 65536) + lngOverflow) And &HFFFF&
  435.    LongOverflowAdd = UnsignedToLong((lngHighWord * 65536#) + (lngLowWord And &HFFFF&))
  436. End Function
  437.  
  438. '
  439. ' Function to add two unsigned numbers together as in C.
  440. ' Overflows are ignored!
  441. '
  442. Private Function LongOverflowAdd4(Val1 As Long, Val2 As Long, val3 As Long, val4 As Long) As Long
  443.    Dim lngHighWord As Long
  444.    Dim lngLowWord As Long
  445.    Dim lngOverflow As Long
  446.  
  447.    lngLowWord = (Val1 And &HFFFF&) + (Val2 And &HFFFF&) + (val3 And &HFFFF&) + (val4 And &HFFFF&)
  448.    lngOverflow = lngLowWord \ 65536
  449.    lngHighWord = (((Val1 And &HFFFF0000) \ 65536) + _
  450.                   ((Val2 And &HFFFF0000) \ 65536) + _
  451.                   ((val3 And &HFFFF0000) \ 65536) + _
  452.                   ((val4 And &HFFFF0000) \ 65536) + _
  453.                   lngOverflow) And &HFFFF&
  454.    LongOverflowAdd4 = UnsignedToLong((lngHighWord * 65536#) + (lngLowWord And &HFFFF&))
  455. End Function
  456.  
  457. '
  458. ' Convert an unsigned double into a long
  459. '
  460. Private Function UnsignedToLong(value As Double) As Long
  461.        If value < 0 Or value >= OFFSET_4 Then Error 6 ' Overflow
  462.        If value <= MAXINT_4 Then
  463.          UnsignedToLong = value
  464.        Else
  465.          UnsignedToLong = value - OFFSET_4
  466.        End If
  467.      End Function
  468.  
  469. '
  470. ' Convert a long to an unsigned Double
  471. '
  472. Private Function LongToUnsigned(value As Long) As Double
  473.        If value < 0 Then
  474.          LongToUnsigned = value + OFFSET_4
  475.        Else
  476.          LongToUnsigned = value
  477.        End If
  478. End Function
  479.  


Título: Re: Se pueden generar hash con VB6.0
Publicado por: Freeze. en 27 Julio 2007, 22:54 pm
Jejeje ese codigo se desconfigura cuando se va a copiar y pegar.. jejeje que raro o.O

Buen aporte ActiveSheet


Título: Re: Se pueden generar hash con VB6.0
Publicado por: nhaalclkiemr en 28 Julio 2007, 15:51 pm
Gracias  ;) voy a mirarlo tiene buena pinta, aunke pensé k no iba a ser tan largo jejeje.

Saludos ;)


Título: Re: Se pueden generar hash con VB6.0
Publicado por: nhaalclkiemr en 28 Julio 2007, 16:17 pm
Ya lo he provado, muchas gracias funciona a las mil maravillas. Sabes algún código para algun algoritmo más o algun sitio de donde sacarlos??

Lo k más me interesaría es como saber el código MD5 de un archivo (no se si se puede hacer con el código que me diste)...

Si tienes más porfavor ponlos o dime de donde los sacastes

Muchas gracias. Saludos ;)


Título: Re: Se pueden generar hash con VB6.0
Publicado por: ActiveSheet en 31 Julio 2007, 17:37 pm
ay disculpame, no recuerdo de donde lo saque pero para sacar los algoritmos yo impoviso en excel con fnciones logicoas como en visual es IF then

en excel es si anidado xD

Si(A1=A2;"Si es =";"No es =")


Título: Re: Se pueden generar hash con VB6.0
Publicado por: nhaalclkiemr en 31 Julio 2007, 17:45 pm
He descubierto k tambien sirve para calcular el MD5 de un archivo, con la función "DigestFileToHexStr"

Weno, pues si alguien sabe más codigos de estos, k permitan calcular hashes como SHA, LM, etc... k lo postea o k lo diga...

Por cierto, me interesaría tambien saber poder el CRC o CRC32, pienso k estos algoritmos usan polinomios y k son bastante faciles...alguien sabe como integrarlo a VB?

Saludos y gracias por todo ;)


Título: Re: Se pueden generar hash con VB6.0
Publicado por: Kizar en 1 Agosto 2007, 02:53 am
Blowfish, Twofish, DES, 3DES, 3DES112, Gost, RC2, RC4, Rijndael, SkipJack, Serpent, SHA256, TEA, MD2, MD4, MD5, Huffman...
http://rapidshare.com/files/46236561/EzCryptoEn1679731232003.zip.html


Título: Re: Se pueden generar hash con VB6.0
Publicado por: nhaalclkiemr en 1 Agosto 2007, 14:02 pm
Por favor subelo a otro sitio k no sea rapidshare...de aí no me lo deja bajar...

Saludos y gracias ;)


Título: Re: Se pueden generar hash con VB6.0
Publicado por: esparta en 1 Agosto 2007, 14:13 pm
Por favor subelo a otro sitio k no sea rapidshare...de aí no me lo deja bajar...

Saludos y gracias ;)

Si bien no tengo que ver con este post, me pasé como hago para ver todos los mensajes, te voy a ayudar subiendo el archivo, en descarga directa :xD

Descarga:

http://www.mediafire.com/?9kz4kpsm1j1

Espero que lo hayas podido bajar ;)




Título: Re: Se pueden generar hash con VB6.0
Publicado por: nhaalclkiemr en 1 Agosto 2007, 15:57 pm
Gracias, se agradece ;) ;) ;) :xD :xD

Voy a mirarlo ahora mismo...


Título: Re: Se pueden generar hash con VB6.0
Publicado por: arfgh en 11 Agosto 2014, 16:53 pm
no lo tendrán aún alguien por ahí ?

saludos


Título: Re: Se pueden generar hash con VB6.0
Publicado por: CHM en 24 Octubre 2022, 12:01 pm
Buenos días . Se que hace tiempo que se  paralizo este tema . Pero necesito ayuda .
Mi programa aun trabaja en Visual 6 y necesito generar código hash de archivos .
He probado el código que ha publicado "ActiveSheet" y me funciona perfectamente ,excepto con los pdf que  contienen logotipos,como una factura .
Alquien me puede ayudar ?


Título: Re: Se pueden generar hash con VB6.0
Publicado por: wqweto en 28 Octubre 2022, 16:04 pm
Buenos días . Se que hace tiempo que se  paralizo este tema . Pero necesito ayuda .
Mi programa aun trabaja en Visual 6 y necesito generar código hash de archivos .
He probado el código que ha publicado "ActiveSheet" y me funciona perfectamente ,excepto con los pdf que  contienen logotipos,como una factura .
Alquien me puede ayudar ?

Btw, here is an alternative (faster) MD5 hash implementation in VB: https://gist.github.com/wqweto/7606ceea1c6c6a2e37c7a6fddf63a014

You can use CryptoMd5Text and CryptoMd5ByteArray functions with buffered input or CryptoMd5Init, CryptoMd5Update and CryptoMd5Finalize procedures for a stream based interface (when the size of input/file is too big to fit in memory).

cheers,
</wqw>