Jump to content

Recommended Posts

_Crypt_EncryptFile() and _Crypt_DecryptFile()  not working ?

or you mean is create Public Key and Private Keys (.cer, .pvk, .pfx) from MakeCert.exe, pvk2pfx.exe and SignTool.exe ?

Regards,
 

Link to post
Share on other sites

Maybe you mean PGP / GPG ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites
On 2.6.2016 at 5:52 AM, giangnguyen said:

I found several threads but they are all outdated 

Are  there any changes in logic. I think no, so you have to read the changelog and update the found source to actual stable or to wait until some one else needs it and is so kind to share.

Link to post
Share on other sites

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites

AutoIt plugin support has been abandonned long ago.

 

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to post
Share on other sites

Need to convert the plugins things

; author Neonium - DLL by peethebee
#include <GUIConstants.au3>

PluginOpen("rsa.dll")
#AutoIt3Wrapper_plugin_funcs = RSA_GenerateKeys, RSA_Decrypt, RSA_Encrypt

Opt("GUIOnEventMode", 1)

$Form1_1 = GUICreate("RSA Encryption", 347, 275, 193, 115)
GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1_1Close")
$tab = GUICtrlCreateTab(10, 10, 325, 260)
$tab0 = GUICtrlCreateTabItem("File")
$vschluessel = GUICtrlCreateButton("Crypt", 40, 230, 115, 25, 0)
GUICtrlSetOnEvent(-1, "vschluesselClick")
$nschluessel = GUICtrlCreateButton("Decrypt", 180, 230, 115, 25, 0)
GUICtrlSetOnEvent(-1, "nschluesselClick")
$Public = GUICtrlCreateLabel("PublicKey File", 20, 124, 70, 17)
$Priv = GUICtrlCreateLabel("PrivateKey File", 20, 152, 74, 17)
$PrivFile = GUICtrlCreateInput("", 104, 152, 117, 21)
$Pubfile = GUICtrlCreateInput("", 104, 120, 117, 21)
$BrowsePub = GUICtrlCreateButton("Browse", 236, 120, 89, 25, 0)
GUICtrlSetOnEvent(-1, "BrowsePubClick")
$BrowsePrv = GUICtrlCreateButton("Browse", 236, 152, 89, 25, 0)
GUICtrlSetOnEvent(-1, "BrowsePrvClick")
$BrowseDat = GUICtrlCreateButton("Browse", 236, 52, 89, 25, 0)
GUICtrlSetOnEvent(-1, "BrowseDatClick")
$Label1 = GUICtrlCreateLabel("File to crypt", 28, 37, 168, 17)
$Datei = GUICtrlCreateInput("", 28, 56, 197, 21)
$privfilegen = GUICtrlCreateButton("Key Files Generator", 100, 190, 125, 25, 0)
GUICtrlSetOnEvent(-1, "privfilegenClick")

$tab1 = GUICtrlCreateTabItem("Password")

$vschluesselp = GUICtrlCreateButton("Crypt", 40, 230, 115, 25, 0)
GUICtrlSetOnEvent(-1, "vschluesselpClick")
$nschluesselp = GUICtrlCreateButton("Decrypt", 180, 230, 115, 25, 0)
GUICtrlSetOnEvent(-1, "nschluesselpClick")
$Publicp = GUICtrlCreateLabel("PublicKey File", 20, 124, 70, 17)
$Privp = GUICtrlCreateLabel("PrivateKey File", 20, 152, 74, 17)
$PrivFilep = GUICtrlCreateInput("", 104, 152, 117, 21)
$Pubfilep = GUICtrlCreateInput("", 104, 120, 117, 21)
$BrowsePubp = GUICtrlCreateButton("Browse", 236, 120, 89, 25, 0)
GUICtrlSetOnEvent(-1, "BrowsePubpClick")
$BrowsePrvp = GUICtrlCreateButton("Browse", 236, 152, 89, 25, 0)
GUICtrlSetOnEvent(-1, "BrowsePrvpClick")
$privfilegenp = GUICtrlCreateButton("Key Files Generator", 100, 190, 125, 25, 0)
GUICtrlSetOnEvent(-1, "privfilegenClick")
$Label1p = GUICtrlCreateLabel("Password clear", 60, 37, 200, 17)
$Dateip = GUICtrlCreateInput("", 60, 56, 197, 21)
$Label2p = GUICtrlCreateLabel("Password crypted:", 60, 78, 200, 17)
$pwp = GUICtrlCreateInput("", 60, 93, 197, 21)
$clipputp = GUICtrlCreateButton("Copy", 265, 93, 60, 21)
GUICtrlSetOnEvent(-1, "clipputpClick")

GUISetState(@SW_SHOW)

$var = IniRead(@WorkingDir & "\file.ini", "privkey", "key", "")
GUICtrlSetData($PrivFile, $var)
$var = IniRead(@WorkingDir & "\file.ini", "pubkey", "key", "")
GUICtrlSetData($Pubfile, $var)
$var = IniRead(@WorkingDir & "\file.ini", "privkeyp", "key", "")
GUICtrlSetData($PrivFilep, $var)
$var = IniRead(@WorkingDir & "\file.ini", "pubkeyp", "key", "")
GUICtrlSetData($Pubfilep, $var)

While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $tab Then
        ; display the clicked tab
        If GUICtrlRead($tab) = 0 Then WinSetTitle("My GUI Tab", "", "My GUI Tab0")
        If GUICtrlRead($tab) = 1 Then WinSetTitle("My GUI Tab", "", "My GUI Tab1")
    EndIf
WEnd

Func AForm1_1Close()
    $readpriv = GUICtrlRead($PrivFile)
    $readpub = GUICtrlRead($Pubfile)
    $readprivp = GUICtrlRead($PrivFilep)
    $readpubp = GUICtrlRead($Pubfilep)

    IniDelete(@ScriptDir & "\file.ini", "privkeyp")
    IniDelete(@ScriptDir & "\file.ini", "pubkeyp")
    IniDelete(@ScriptDir & "\file.ini", "privkey")
    IniDelete(@ScriptDir & "\file.ini", "pubkey")

    If $readpriv <> "" Then
        IniWrite(@ScriptDir & "\file.ini", "privkey", "key", $readpriv)
    EndIf
    If $readpub <> "" Then
        IniWrite(@ScriptDir & "\file.ini", "pubkey", "key", $readpub)
    EndIf

    If $readprivp <> "" Then
        IniWrite(@ScriptDir & "\file.ini", "privkeyp", "key", $readprivp)
    EndIf
    If $readpubp <> "" Then
        IniWrite(@ScriptDir & "\file.ini", "pubkeyp", "key", $readpubp)
    EndIf
    Exit
EndFunc   ;==>AForm1_1Close

Func BrowseDatClick()
    $readdatei = GUICtrlRead($Datei)
    $var = FileOpenDialog("Datei", $readdatei, "Text (*.txt)", 1)
    GUICtrlSetData($Datei, $var)
EndFunc   ;==>BrowseDatClick

Func BrowsePrvClick()
    $readpriv = GUICtrlRead($PrivFile)
    $var = FileOpenDialog("Datei", $readpriv, "Private (*.privkey)", 1)
    GUICtrlSetData($PrivFile, $var)
EndFunc   ;==>BrowsePrvClick

Func BrowsePubClick()
    $readpub = GUICtrlRead($Pubfile)
    $var = FileOpenDialog("Datei", $readpub, "Public (*.pubkey)", 1)
    GUICtrlSetData($Pubfile, $var)
EndFunc   ;==>BrowsePubClick

Func nschluesselClick()
    $readpriv = GUICtrlRead($PrivFile)
    $read = GUICtrlRead($Datei)
    If $readpriv = "" Or $read = "" Then
        MsgBox(0, "ERROR", "Please select only the key files")
    Else
        FileMove($read, "c:\tmp\test.txt")
        FileChangeDir("C:\tmp")
        $file = FileOpen("test.txt", 0)
        If $file = -1 Then
            MsgBox(0, "Error", "Unable to open file.")
            Exit
        EndIf
        $line = FileRead($file)
        FileClose($file)
        $line = RSA_Decrypt($line, $readpriv)
        $file = FileOpen("test.txt", 2)
        FileWrite($file, $line)
        FileClose($file)
        FileMove("C:\tmp\test.txt", $read)
        MsgBox(0, "", "Successful")
    EndIf
EndFunc   ;==>nschluesselClick

Func vschluesselClick()
    $readpub = GUICtrlRead($Pubfile)
    $read = GUICtrlRead($Datei)
    If $readpub = "" Or $read = "" Then
        MsgBox(0, "ERROR", "Please select only the key files")
    Else
        FileMove($read, "C:\tmp\test.txt")
        FileChangeDir("C:\tmp")
        $file = FileOpen("test.txt", 0)
        If $file = -1 Then
            MsgBox(0, "Error", "Unable to open file.")
            Exit
        EndIf
        $line = FileRead($file)
        FileClose($file)
        $line = RSA_Encrypt($line, $readpub)
        $file = FileOpen("test.txt", 2)
        FileWrite($file, $line)
        FileClose($file)
        FileMove("C:\tmp\test.txt", $read)
        MsgBox(0, "Successful", "Encrypted success")
    EndIf
EndFunc   ;==>vschluesselClick

Func privfilegenClick()
    $folder = FileSelectFolder("Keyfiles Location", Default, 1)
    $folder = $folder & "\"
    $bitlen = InputBox("Bit length", "Key bit length", "50")
    $name = InputBox("Store name", "Memory name Keyfiles")
    If $folder <> "" And $name <> "" And $bitlen <> "" Then
        RSA_GenerateKeys($bitlen, $folder, $name)
        MsgBox(0, "Successful", "Keys were created successfully")
    Else
        MsgBox(0, "Error", "Please provide all information")
    EndIf
EndFunc   ;==>privfilegenClick

Func BrowsePrvpClick()
    $readpriv = GUICtrlRead($PrivFilep)
    $var = FileOpenDialog("Datei", $readpriv, "Private (*.privkey)", 1)
    GUICtrlSetData($PrivFilep, $var)
EndFunc   ;==>BrowsePrvpClick

Func BrowsePubpClick()
    $readpub = GUICtrlRead($Pubfilep)
    $var = FileOpenDialog("Datei", $readpub, "Public (*.pubkey)", 1)
    GUICtrlSetData($Pubfilep, $var)
EndFunc   ;==>BrowsePubpClick

Func nschluesselpClick()
    $readpriv = GUICtrlRead($PrivFilep)
    $read = GUICtrlRead($pwp)
    If $readpriv = "" Or $read = "" Then
        MsgBox(0, "ERROR", "Please select only the key files")
    Else
        $pw = RSA_Decrypt($read, $readpriv)
        GUICtrlSetData($Dateip, $pw)
    EndIf
EndFunc   ;==>nschluesselpClick

Func vschluesselpClick()
    $readpub = GUICtrlRead($Pubfilep)
    $read = GUICtrlRead($Dateip)
    If $readpub = "" Or $read = "" Then
        MsgBox(0, "ERROR", "Please select only the key files")
    Else
        $pw = RSA_Encrypt($read, $readpub)
        GUICtrlSetData($pwp, $pw)
    EndIf
EndFunc   ;==>vschluesselpClick

Func clipputpClick()
    ClipPut(GUICtrlRead($pwp))
EndFunc   ;==>clipputpClick

 

RSA.dll

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to post
Share on other sites

Here is an example showing some other concepts:

Indeed it is using crypto card, but I believe that using Certificate Enrollment API  you can do what you need, all is a matter of your own involmend.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites
  • 4 weeks later...

Still needing this.

mLipok, I think your script basically prints out the detail of a certificate? Not sure how that helps, since I am not signing but encrypting and decrypting to secure data (since autoit is easily decompiled, and therefore AES keys can be stolen. However RSA can't because it is public/private key)

Link to post
Share on other sites
  • 2 weeks later...
On 11.6.2016 at 3:01 PM, mLipok said:

Indeed it is using crypto card, but I believe that using Certificate Enrollment API  you can do what you need, all is a matter of your own involmend.

What are the issue by coding a test script using the Certificate Enrollment API? Please show script. Or is there any  Oozlum bird that eaten your script and fly away?

Link to post
Share on other sites

So reading here:

About the Certificate Enrollment API

Quote

The Certificate Enrollment API enables you to create client applications that can be used to request and install certificates.

There is nothing about singnig/encrypting.

 

After some diging I comes to this:
Cryptography API: Next Generation
About CNG
Encrypting Data with CNG

Please check this above links and say what you think.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By RTFC
      CodeCrypter enables you to encrypt scripts without placing the key inside the script.
      This is because this key is extracted from the user environment at runtime by, for example:
      password user query any macro (e.g., @username) any AutoIt function call any UDF call some permanent environment variable on a specific machine (and not created by your script) a server response a device response anything else you can think of, as long as it's not stored in the script any combination of the above You need several scripts to get this to work, and they are scattered over several threads, so here's a single bundle that contains them all (including a patched version of Ward's AES.au3; with many thanks to Ward for allowing me to include this script here):
      Latest version: 3.4 (3 Dec 2021): please follow this link.
      Note: if you experience issues under Win8/8.1 (as some users have reported), please upgrade to Win10 (or use Win7) if you can; as far as I can tell, the scripts in the bundle all work under Win7 & Win10 (and XP). Moreover, I have no access to a Win8 box, so these issues will not be fixed, at least not by yours truly.
       
      How the bits and pieces fit together:
      CodeCrypter is a front-end for the MCF UDF library (you need version 1.3 or later). Its thread is here:
      '?do=embed' frameborder='0' data-embedContent>>
      The MCF package (also contained in the CodeScannerCrypter bundle) contains MCF.au3 (the library itself) plus a little include file called MCFinclude.au3. The latter you have to include in any script you wish to encrypt. Any code preceding it will not be encrypted, any code following it will be encrypted. You define the dynamic key inside MCFinclude.au3, in the UDF: _MCFCC_Init().
      From the same post you can download an MCF Tutorial which I heartily recommend, because encrypting a script requires a number of steps in the right order, namely:
      In MCFinclude.au3, define and/or choose your dynamic key(s) (skip this step = use default setting) include MCFinclude.au3 in your target script Run CodeScanner (version 2.3+) on your target script, with setting WriteMetaCode=True (see '?do=embed' frameborder='0' data-embedContent>>), then close CodeScanner. Start CodeCrypter press the Source button to load your target file enable Write MCF0 (tick the first option in Main Settings) Enable "Encrypt" (last option in the Main Settings) Go to the Tab Encrypt and set up the encryption the way you want (skip this = use default settings) Return to Main Tab and press "Run" if all goes well, a new script called MCF0test.au3 is created in the same directory as your target. It has no includes and no redundant parts. Please check that it works as normal. (see Remarks if not) It all sounds far more complicated than it is, really.
      Not convinced? Check out:
      a simple HowTo Guide: HowToCodeCrypt.pdf an updated and extended Q & A pdf (FAQ, also included in the bundle) to help you get started:CodeCrypterFAQ.pdf For additional explanations/examples in response to specific questions by forum members (how it works, what it can/cannot do), see elsewhere in this thread, notably:
      Simple analogy of how it works: post #53, second part General Explanation and HowTo: post #9, 51, 75, 185/187, 196, 207, 270, 280 (this gets a bit repetitive) BackTranslation: post #179 Obfuscation: post #36 (general), 49 (selective obfuscation) Specific features and fixes: post #3 (security), 84 (redefining the expected runtime response), 169 (Curl Enum fix), 185/187 (using license keys), 194 (replacing Ward's AES UDF with different encryption/decryption calls), 251 (AV detection issue), 262 (extract key contents to USB on different target machine prior to encryption) Limitations: post #26 (@error/@extended), 149 (FileInstall), 191 (AES.au3 on x64) Not recommended: post #46/249 (static encryption), 102 (programme logic error), 237 (parsing password via cmdline)  
      Technical notes:
      BackTranslation is a test to check that the MetaCode translation worked. Skip it at your peril. It also turns your multi-include composite script into a single portable file without redundant parts (you can opt to leave the redundant parts in, if you want).
      CodeCrypter can also obfuscate (vars and UDF names) and replace strings, variable names and UDF names with anything else you provide, for  example, for language translation). After CodeScanner separates your target's structure from its contents, CodeCrypter (actually MCF, under the hood) can change any part, and then generate a new script from whichever pieces you define. See the MCF Tutorial for more explanation and examples.
      Encryption currently relies on Ward's excellent AES UDF and TheXman's sophisticated CryptoNG bundle. You can replace these with any other algorithm you like (but this is not trivial to do: edit MCFinclude.au3 UDF _MCFCC(), and MCF.au3 UDF _EncryptEntry(), see post #194 in this thread). AES by Ward, and CryptoNG by TheXman are also included in the bundle (with many thanks to Ward and TheXman for graciously allowing me to republish their outstanding work).
      Going to lie down now...
      RT
       
    • By RTFC
      The CodeScannerCrypterBundle (ca. 2.9 MB unzipped) contains the following UDFs and utilities:
      CodeScanner: analyse AutoIt script structure and content, identify potential issues, generate MCF data files CodeCrypter: front-end GUI for the MCF library, for script encryption (without storing the decryption key(s) in the script!) MetaCodeFile UDF (MCF library): for analysis and user-defined alterations of AutoIt script structure and content MCFinclude.au3: #include this UDF in any AutoIt script that you wish CodeCrypter to process CryptoNG, by TheXman; encryption UDF using Bcrypt dll calls (32/64-bit; various algorithms) StoreCCprofile.au3/readCSdatadump.au3/helloworld.au3: auxiliary utilities and example script HowToCodeCrypt.pdf: a simple guide in five steps CodeCrypterFAQ.pdf: questions and answers, partly based upon exchanges in the CodeCrypter thread. MetaCodeTutorial.pdf: the MCF engine explained; useful for encryption, GUI translation, code translation, and much more... Please follow the links for additional information.
    • By TheXman
      Encryption / Decryption / Hashing
      Purpose
      Cryptography API: Next Generation (CNG) is Microsoft's long-term replacement for their CryptoAPI.  CNG is designed to be extensible at many levels and cryptography agnostic in behavior.  Although the Crypt.au3 UDF that is installed with AutoIt3 still works perfectly, the advapi32.dll functions that it uses have been deprecated.  This UDF was created to offer a replacement for the deprecated functions.  According to Microsoft, deprecated functions may be removed in future release.  Therefore, this UDF will be available when/if that happens.
      Description
      This UDF implements some of Microsoft's Cryptography API: Next Generation (CNG) Win32 API functions.  In its initial release, it implements functions to encrypt text & files, decrypt text and files, generate hashes, and the Password-Based Key Derivation Function 2 (PBKDF2) function.  The UDF can implement any of the encryption/decryption algorithms or hashing algorithms that are installed on the PC in which it is running.  Most, if not all, of the values that you would commonly use to specify that desired algorithms, key bit lengths, and other magic number type values, are already defined as constants or enums in the UDF file.
      To flatten the learning curve, there is an example file that shows examples of all of the major functionality.  This example file is not created to be an exhaustive set of how to implement each feature and parameter.  It is designed to give you a template or guide to help you hit the ground running in terms of using the functions.  I have tried to fully document the headers of all of the functions as well as the code within the functions themselves.    As of v1.4.0, there is also a Help file that includes all of the functions, with examples.
      Current UDF Functions
      Algorithm-Specific Symmetric Encryption/Decryption Functions _CryptoNG_3DES_CBC_DecryptData _CryptoNG_3DES_CBC_DecryptFile _CryptoNG_3DES_CBC_EncryptData _CryptoNG_3DES_CBC_EncryptFile _CryptoNG_AES_CBC_DecryptData _CryptoNG_AES_CBC_DecryptFile _CryptoNG_AES_CBC_EncryptData _CryptoNG_AES_CBC_EncryptFile _CryptoNG_AES_ECB_DecryptData _CryptoNG_AES_ECB_EncryptData
        Generic Symmetric Encryption/Decryption Functions _CryptoNG_DecryptData _CryptoNG_DecryptFile _CryptoNG_EncryptData _CryptoNG_EncryptFile
        Hashing Functions _CryptoNG_HashData _CryptoNG_HashFile _CryptoNG_PBKDF2
        Asymmetric (Public/Private Key) Encryption/Decryption Functions _CryptoNG_RSA_CreateKeyPair _CryptoNG_RSA_EncryptData _CryptoNG_RSA_DecryptData
        Misc / Helper Functions _CryptoNG_CryptBinaryToString _CryptoNG_CryptStringToBinary _CryptoNG_GenerateRandom _CryptoNG_EnumAlgorithms _CryptoNG_EnumRegisteredProviders _CryptoNG_EnumKeyStorageProviders _CryptoNG_LastErrorMessage _CryptoNG_Version  
      Related Links
      Cryptography API: Next Generation - Main Page
      Cryptography API: Next Generation - Reference
      Cryptography API: Next Generation - Primitives
      Cryptography API: Next Generation - Cryptographic Algorithm Providers
    • By RTFC
      MetaCode offers a way to:
      separate a script's structure from its content remove all redundant definitions (globals and UDFs) change any content (and some structure) combine (new) structure and (new) content into a new script The most useful applications implemented so far are:
      Fast language translation (not just text strings, also variable names and UDF names) Obfuscation (vars and/or UDFs) Script Encryption (conditionals, calls, and macros) Encryption is powerful because the key is not stored anywhere; you can define it to be a user password, macro, environment spec/variable, server response, something you define yourself, or a combination thereof; anything goes, as long as it's not a fixed string or fixed value. More info in the CodeCrypter thread: ?do=embed' frameborder='0' data-embedContent>'?do=embed' frameborder='0' data-embedContent>>
      ?do=embed' frameborder='0' data-embedContent>
      But MetaCode has more potential than that; it allows you to tinker with any type of content separately, then rebuild a new version. So for example, you can have a single script structure and numerous different language modules you just plug in to create a new version in a different language.
      A brief Tutorial is here: MetaCode Tutorial.pdf
      The MCF library itself can be found in the CodeScannerCrypter bundle.
      And a little example how to use it for translating your GUI into a different language:
       UI_Translator.7z (new version that should work with the new version of Google Translate, see post #13 below)
       
       
      MCF.au3 is just the library plus the MCFinclude.au3 file you need to include in any script you wish to encrypt.
      There is no GUI here. However, I did write a separate front-end for it called CodeCrypter, which you can find here:
      ?do=embed' frameborder='0' data-embedContent>'?do=embed' frameborder='0' data-embedContent>>
      ?do=embed' frameborder='0' data-embedContent>
      MCF uses output generated by my CodeScanner version 2.8+, which you can find here:
      '?do=embed' frameborder='0' data-embedContent>>
      CodeScanner also depends on MCF.au3 now, as it can now call a few of its functions.
      I should also mention Ward's excellent AES.au3 UDFs used for the encryption and decryption calls,  which is now included in the CodeScannerCrypter bundle (thanks to Ward for allowing to include it). You can find the original (unpatched) version here:
      '?do=embed' frameborder='0' data-embedContent>>
      Note: you can replace the encryption/decryption calls with whatever algorithm you like (hint: the native <Crypt.au3> library is too slow for most purposes, better stick to machine code routines)
      So just to be clear:
      CodeScanner (v2.8+) needs MCF (earlier versions won't work!) CodeCrypter needs MCF (plus anything that MCF needs) MCF itself needs MCFinclude (part of MCF zip) MCF also needs readCSdatadump (part of the CodeScanner package, you need the latest version packaged with CodeScanner v2.8; earlier versions won't work!) both MCF and MCFinclude currently rely on AES.au3 by Ward So you basically need to download the whole bundle for any of it to work.
       
      If you have any questions, please start by reading the MCF Tutorial and the CodeCrypter FAQ (you can download the latter separately from the CodeCrypter thread).
      Next, read the extensive Remarks sections in MCF.au3, MCFinclude.au3, and CodeCrypter.au3
      If still no joy, then please post. However, I'm not online that often, and logged in to the forum even less, so response may take a while).
      RT
    • By Radix
      Hi.

      I would like to know if it is possible to implement an autoit script with GOST algorithm. I noticed that there are seven different algorithms in the standard UDF, but I urgently need a command line crypter with GOST algorithm. I just lack the algorithm part. Is it possible to adapt GPLib in the autoit script?

      http://www.delphipages.com/comp/gplib-14771.html

      Thx.
×
×
  • Create New...