Network_Guy Posted February 1, 2019 Share Posted February 1, 2019 Dear Autoit community , i done telnet via TCP socket using pure autoit , i just need to do the same but using SSH , i searched the forums but cant find any example for it using sockets ,i just found some examples using CLI blink but that not what i need . what i looking for a way to generate RSA pair of key , decrypt or encrypt data by using those keys . any idea ? Link to comment Share on other sites More sharing options...
caramen Posted February 1, 2019 Share Posted February 1, 2019 With Crypt.au3 You can crypt decrypt with these key : CALG_MD2; CALG_MD4; CALG_MD5; CALG_SHA1; CALG_SHA_256; CALG_SHA_384; CALG_SHA_512; CALG_3DES; CALG_AES_128; CALG_AES_192 CALG_AES_256; CALG_DES; CALG_RC2; CALG_RC4; PROV_RSA_FULL; PROV_RSA_AES; #include <Crypt.au3> Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data. Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted. Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_RC4) ; Encrypt the data using the generic password string. MsgBox(0, "Crypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted)) MsgBox(0, "Crypted data", "Nothing"&@CRLF&$bEncrypted) MsgBox(0, "Crypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted)) $bEncrypted = _Crypt_DecryptData($bEncrypted, $sUserKey, $CALG_RC4) ; Decrypt the data using the generic password string. The return value is a binary string. MsgBox(0, "Decrypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted)) ; Convert the binary string using BinaryToString to display the initial data we encrypted. MsgBox(0, "Decrypted data", "Nothing"&@CRLF&$bEncrypted) MsgBox(0, "Decrypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted)) My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Network_Guy Posted February 1, 2019 Author Share Posted February 1, 2019 17 hours ago, caramen said: With Crypt.au3 You can crypt decrypt with these key : CALG_MD2; CALG_MD4; CALG_MD5; CALG_SHA1; CALG_SHA_256; CALG_SHA_384; CALG_SHA_512; CALG_3DES; CALG_AES_128; CALG_AES_192 CALG_AES_256; CALG_DES; CALG_RC2; CALG_RC4; PROV_RSA_FULL; PROV_RSA_AES; #include <Crypt.au3> Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data. Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted. Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_RC4) ; Encrypt the data using the generic password string. MsgBox(0, "Crypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted)) MsgBox(0, "Crypted data", "Nothing"&@CRLF&$bEncrypted) MsgBox(0, "Crypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted)) $bEncrypted = _Crypt_DecryptData($bEncrypted, $sUserKey, $CALG_RC4) ; Decrypt the data using the generic password string. The return value is a binary string. MsgBox(0, "Decrypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted)) ; Convert the binary string using BinaryToString to display the initial data we encrypted. MsgBox(0, "Decrypted data", "Nothing"&@CRLF&$bEncrypted) MsgBox(0, "Decrypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted)) ty for reply but i cant find any RSA Encryption Algorithm ID in crypt UDF + the example provided using symetric RC4 not Asymetric RSA what i seek. if crypt.au3 support RSA can u give me a working example for generating public and private keys , encryption or decryption using them . Link to comment Share on other sites More sharing options...
RTFC Posted February 1, 2019 Share Posted February 1, 2019 @Network_Guy: the Example Scripts Forum contains lots of interesting stuff, like this. @caramen: Maybe study the difference between a hash function and an encryption algorithm before you confuse others. My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O Link to comment Share on other sites More sharing options...
caramen Posted February 1, 2019 Share Posted February 1, 2019 No worry i Know it was not asked. But sometime you can swap your first goal. anyway i shared all i Know sry i canot do much more My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Network_Guy Posted February 1, 2019 Author Share Posted February 1, 2019 @RTFC ty for trying help but i think u missed what i need , here is example using C# :-https://blogs.msdn.microsoft.com/alejacma/2008/10/23/how-to-generate-key-pairs-encrypt-and-decrypt-data-with-net-c/ can i do the same with Autoit ? Link to comment Share on other sites More sharing options...
TheXman Posted February 1, 2019 Share Posted February 1, 2019 2 hours ago, Network_Guy said: can i do the same with Autoit ? The short answer is yes. If you have the skill, time, and desire, you could use the builtin Windows crypto functions like the ones exposed in the bcrypt.dll, you could use a 3rd party set of functions, like the ones provided by Chilkat, or you could use a combination of command line tools, like OpenSSH, and DLL calls to achieve whatever it is you are trying to do. In AutoIt, you would use the Dll* functions to create the necessary structures. get/set the structure data, open/close the required dll(s), and to call the functions that you need. There may even be ways to use some of the .Net assemblies through COM. I see that there are numerous System.Security.Cryptography CLSIDs defined on my machine but I never tried to use any of those through COM. With AutoIt, your options are almost limitless. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Network_Guy Posted February 1, 2019 Author Share Posted February 1, 2019 (edited) @TheXman ,thank you that what i am looking for . Edited February 1, 2019 by Network_Guy Link to comment Share on other sites More sharing options...
TheXman Posted February 1, 2019 Share Posted February 1, 2019 You're welcome Network_Guy 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now