• Creator
    Topic
  • #4137
    emischie
    Participant

      Hi,

      I try to use utilities.DESEncrytion method and
      the result looks very strange.

      Here is the code:


      sPlain = "this is just an example"
      iHighKey = 0
      iLowKey = 0

      sEncrypt = utilities.DESEncryption(fEncrypt, iHighKey, iLowKey, sPlain)
      sDecrypt = utilities.DESEncryption(fDecrypt, iHighKey, iLowKey, sEncrypt)
      sEncrypt2 = utilities.DESEncryption(fDecryfEncryptpt, iHighKey, iLowKey, sDecrypt)
      utilities.ToClipBoard("sPlain = " & sPlain & vbCrLf & "sEncrypt = " & sEncrypt & vbCrLf & "sDecrypt = " & sDecrypt & vbCrLf)

      Output of it is:


      sPlain = this is just an example
      sEncrypt = ø°Ç€ˆ¹—ëûMÒïö¢å«š
      —ƒÚûb
      sDecrypt = this is just an exampleÀf6w"(B~

      The decrypted message contains indeed the clear text one but is padded with some weird stuff.

      Also changing the 2 keys values to iHighKey = 12345 and iLowKey = 1234 gives a completely unexpected result:


      sPlain = this is just an example
      sEncrypt = K¸G‹ÖÉùB‹ _µHAmôÏæ“ "
      sDecrypt = "/m!ǘ-µkó<B–Nè
      Û
      _AŸßª

      Can you please tell me how I vcan make effective use of this method?

      Thanks,
      Eugen!

    • Author
      Replies
    • #7236
      Support 1a
      Participant

        Unfortunately I cannot reproduce this using your applet. The data is correctly encrypted and decrypted using 0 and the values you provided for the low and high keys.

        I wonder if using the Clipboard is a factor. Here is the code I used to test the method, which uses a MsgBox to outout values. I would be interested to see if this works for you:

        Sub Main(Client, GWEvent)
        
           dim aPlain
           dim iHighKey
           dim iLowKey
        
           sPlain = "this is just an example"
           iHighKey = 145
           iLowKey = 1234
        
           sEncrypt = utilities.DESEncryption(fEncrypt, iHighKey, iLowKey, sPlain)
           sDecrypt = utilities.DESEncryption(fDecrypt, iHighKey, iLowKey, sEncrypt)
           MsgBox("sPlain = " & sPlain & vbCrLf & "sEncrypt = " & sEncrypt & vbCrLf & "sDecrypt = " & sDecrypt & vbCrLf)
        
        End Sub

        Advansys Support

      Viewing 1 replies (of 1 total)
      • You must be logged in to reply to this topic.