Jump to content

Search the Community

Showing results for tags 'Function not found in the dll'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Here is my vb .net code. This works from a console application, however this is not working while being called from an AutoIt script using DLLCall. Can someone tell me what I am doing wrong? Console Application: Module Module1 Sub Main() Dim strEncrypt As String = Decide("Encrypt", "Hello") Console.WriteLine("The encrypted value is: " & strEncrypt) Console.ReadLine() Dim strDecrypt As String = Decide("Decrypt", strEncrypt) Console.WriteLine("The decrypted value is: " & strDecrypt) Console.ReadLine() End Sub End Module VB.NET DLL Code Imports System.IO Imports System.Text Imports System.Security.Cryptography Public Class Crypto Private Shared DES As New TripleDESCryptoServiceProvider Private Shared MD5 As New MD5CryptoServiceProvider Private Shared Function MD5Hash(ByVal value As String) As Byte() Return MD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(value)) End Function Private Shared Function Encrypt(ByVal stringToEncrypt As String, ByVal key As String) As String DES.Key = Crypto.MD5Hash(key) DES.Mode = CipherMode.ECB Dim Buffer As Byte() = ASCIIEncoding.ASCII.GetBytes(stringToEncrypt) Return Convert.ToBase64String(DES.CreateEncryptor().TransformFinalBlock(Buffer, 0, Buffer.Length)) End Function Private Shared Function Decrypt(ByVal encryptedString As String, ByVal key As String) As String Try DES.Key = Crypto.MD5Hash(key) DES.Mode = CipherMode.ECB Dim Buffer As Byte() = Convert.FromBase64String(encryptedString) Return ASCIIEncoding.ASCII.GetString(DES.CreateDecryptor().TransformFinalBlock(Buffer, 0, Buffer.Length)) Catch ex As Exception 'MessageBox.Show("Invalid Key", "Decryption Failed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) 'Console.WriteLine("Invalid Key - Decryption Failed") Return "ERROR" End Try End Function Public Shared Function Decide(ByVal strEncryptOrDecrypt As String, ByVal strParameter As String) As String Dim EncryptionKey As String = "Decryption String Goes Here!" If strEncryptOrDecrypt = "Encrypt" Then Dim strEncrypted As String = Crypto.Encrypt(strParameter, EncryptionKey) Return strEncrypted ElseIf strEncryptOrDecrypt = "Decrypt" Then Dim strDecrypted As String = Crypto.Decrypt(strParameter, EncryptionKey) Return strDecrypted Else Return "ERROR" End If End Function End Class AutoIt code: $myDll = @ScriptDir & "\Encryption.dll" $result = DllCall($myDll, "str", "Decide", "str", "Encrypt", "str", "Happy") MsgBox(0,"@Error", @error)
×
×
  • Create New...