Advertisement
Najeebsk

OPENSSL-SELECTED-DIR-ENCRYPT-DECRYPT.ahk

Jan 26th, 2024
920
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*   INFO NAJEEB OPENSSL FILES ENCRYPTION
  2.    Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
  3.    Last Modified: 1-26-2024
  4. */
  5. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  6. ;#warn
  7. #NoEnv
  8. #SingleInstance, Force
  9. SetBatchLines, -1
  10. setworkingdir,%a_scriptdir%
  11. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  12. SkinForm(Apply, A_ScriptDir . "\DATA\USkin.dll", A_ScriptDir . "\DATA\M1.msstyles")
  13. OnExit, GetOut
  14. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  15. Gui,default
  16. Gui,Color, 091D33, 091D33
  17. Gui,Font, s12 cDDDDDD, Calibri
  18. Gui, Add, Text, X10 Y13, Select:
  19. Gui, Add, Edit, X110 Y13 vFolderEdit -Multi ReadOnly, % A_ScriptDir ; Default folder
  20. Gui, Add, Button, X350 Y10 gBrowseButton, Browse
  21. Gui, Add, Text, X10 Y63, Password:
  22. Gui, Add, Edit, X110 Y60 Password vPasswordEdit
  23. Gui, Add, Text, X10 Y123, File EXT:
  24. Gui, Add, Edit, X110 Y120 vFEXT
  25. Gui, Add, Button, Default X350 Y120 gEncryptButton, Encrypt
  26. Gui, Add, Text, X10 Y183, File EXT:
  27. Gui, Add, Edit, X110 Y180 w180 vFEXT2, enc
  28. Gui, Add, Button, X350 Y180 gDecryptButton, Decrypt
  29. Gui, Show, W450 H250 X20 Y0, Najeeb Files Encryption Tools
  30.  
  31. Return
  32.  
  33. BrowseButton:
  34.    FileSelectFolder, SelectedFolder
  35.     GuiControl,, FolderEdit, %SelectedFolder%
  36. Return
  37.  
  38. EncryptButton:
  39.    Gui, Submit, NoHide
  40.     Loop, Files, %FolderEdit%\*.%FEXT% ; Change the extension based on your File format
  41.     {
  42.         CurrentFile := A_LoopFileFullPath
  43.         EncryptedFile := A_LoopFileDir "\" A_LoopFileName ".enc"
  44.         Password := GuiControlGet,,PasswordEdit
  45.        
  46.         ; Use OpenSSL or another encryption tool to encrypt the File with the provided password
  47.         ; Replace the following line with your encryption command
  48.         RunWait, DATA\openssl.exe enc -aes-256-cbc -in "%CurrentFile%" -out "%EncryptedFile%" -k "%Password%"
  49.     }
  50.     MsgBox, Encryption completed.
  51. Return
  52.  
  53. DecryptButton:
  54.    Gui, Submit, NoHide
  55.     Loop, Files, %FolderEdit%\*.%FEXT2% ; Change the extension based on your encrypted format
  56.     {
  57.         CurrentFile := A_LoopFileFullPath
  58.         DecryptedFile := A_LoopFileDir "\" A_LoopFileName ".Nul"
  59.         Password := GuiControlGet,,PasswordEdit
  60.        
  61.         ; Use OpenSSL or another decryption tool to decrypt the File with the provided password
  62.         ; Replace the following line with your decryption command
  63.         RunWait, DATA\openssl.exe enc -aes-256-cbc -d -in "%CurrentFile%" -out "%DecryptedFile%" -k "%Password%"
  64.     }
  65.     MsgBox, Decryption completed.
  66. Return
  67. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  68. GetOut:
  69. ;GuiClose:
  70. Gui, Hide
  71. SkinForm(0)
  72. ExitApp
  73. Return
  74.  
  75. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  76.     if(Param1 = Apply){
  77.         DllCall("LoadLibrary", str, DLL)
  78.         DllCall(DLL . "\USkinInit", Int,0, Int,0, AStr, SkinName)
  79.     }else if(Param1 = 0){
  80.         DllCall(DLL . "\USkinExit")
  81.         }
  82. }
  83. ;============ END SCRIPT BUTTON_MENU ==============
  84. #R::Reload
  85. #S::Suspend
  86. #P::Pause
  87. #ESC::ExitApp
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement