gahhon Posted December 11, 2018 Posted December 11, 2018 Hi, I have a program that is read data from the .txt file, since the .txt file is only readable, viewable and editable for the admin user. But how could I lock it with password, or some other technique that can helps to achieve this? Thanks for the advanced information.
Nine Posted December 11, 2018 Posted December 11, 2018 Well there is multiple possibilities here. The simplest would be to place the .txt file into a directory (like windows\system32) only accessible by admin and give admin priv to the script (#RequireAdmin). “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
jdelaney Posted December 11, 2018 Posted December 11, 2018 You can encrypt it with a key. the key is your password, and required to decrypt it. ..search in the helpfile for then crypt functions IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
caramen Posted December 12, 2018 Posted December 12, 2018 (edited) Hey hello, To learn crypt decrypt to everyone i got this script. Say us if you need help but if you read this slow you will figure out how to do i guess. #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)) Now you can combine that with anyscript. 3 tips : - With crypted data in a file the file will be able to be open. - With text file in Admin dir it will be able to be read but cannot be deleted. - With crypted data in admin dir : It wont be able to be delete but can be read but not understanable by peoples. Edited December 12, 2018 by caramen 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
rudi Posted December 18, 2018 Posted December 18, 2018 Hi. Almost like mentioned above already: I guess, that your file is placed on some network share, as different users have to access it. If the content is not secret, use NTFS or SHARE rights (or both) to grant write access to only those users, that shall be able to modify the TXT file's content. To do so I'd like to recommend to use an existing group or to create a new one. Then all you need to do to is to add or remove the qualified users to / from this group. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
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