Advertisement
Najeebsk

OPENSSL-SELECTED-EXT-ENCRYPT-DECRYPT.ahk

Jan 26th, 2024 (edited)
1,074
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-27-2024
  4.    Download DATA Folder Here
  5.    https://drive.google.com/file/d/1NTPP-YAb6TrPxrqWxlo7IOo6_z9lVgGv/view?usp=sharing
  6. */
  7. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  8. ;#warn
  9. #NoEnv
  10. #SingleInstance, Force
  11. SetBatchLines, -1
  12. setworkingdir,%a_scriptdir%
  13. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  14. SkinForm(Apply, A_ScriptDir . "\DATA\USkin.dll", A_ScriptDir . "\DATA\M1.msstyles")
  15. OnExit, GetOut
  16. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  17. Gui,default
  18. Gui,Color, 091D33, 091D33
  19. Gui,Font, s12 cDDDDDD, Calibri
  20. Gui, Add, Text, x10 y10 w200 h20, (FileName.enc)(FileName.EXT)
  21. Gui, Add, Text, x10 y30 w80 h20, Extenion:
  22. Gui, Add, Edit, x100 y30 w120 h20 vEXT
  23. Gui, Add, Text, x10 y60 w80 h20, Password:
  24. Gui, Add, Edit, x100 y60 w120 h20 vPassword, ; vPassword assigns the input to the variable Password
  25. Gui, Add, Button, x10 y100 w100 h30 gEncrypt, Encrypt Files
  26. Gui, Add, Button, x120 y100 w100 h30 gDecrypt, Decrypt Files
  27. Gui, Show, , File Encryption Tool
  28. return
  29.  
  30. Encrypt:
  31.    Gui, Submit, NoHide
  32.     ; Get the list of files to encrypt
  33.     FileSelectFile, FilesToEncrypt, 3,, Select files to encrypt, (*.*)|*.*
  34.  
  35.     ; Check if the user selected any files and entered a password
  36.     if (FilesToEncrypt)
  37. {
  38.     GuiControlGet, Password,
  39.         ; Use OpenSSL to encrypt the files
  40.         RunWait, DATA\openssl.exe enc -aes-256-cbc -salt -in %FilesToEncrypt% -out %EXT% -k "%Password%"
  41.  
  42.         ; Provide feedback to the user
  43.         MsgBox, Encryption complete. Output saved to encrypted_files.enc.
  44.     } else {
  45.         MsgBox, No files selected for encryption or password not entered.
  46.     }
  47. return
  48.  
  49. Decrypt:
  50.    Gui, Submit, NoHide
  51.     ; Get the file to decrypt
  52.     FileSelectFile, EncryptedFile, 1,, Select file to decrypt, (*.enc)|*.enc
  53.  
  54.     ; Check if the user selected any file and entered a password
  55.     if (FilesToEncrypt)
  56. {
  57.     GuiControlGet, Password,
  58.  
  59.  
  60.         ; Use OpenSSL to decrypt the file
  61.         RunWait, DATA\openssl.exe enc -aes-256-cbc -d -in %EncryptedFile% -out %EXT% -k "%Password%"
  62.  
  63.         ; Provide feedback to the user
  64.         MsgBox, Decryption complete. Output saved to decrypted_files.
  65.     } else {
  66.         MsgBox, No file selected for decryption or password not entered.
  67.     }
  68. return
  69.  
  70. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  71. GetOut:
  72. ;GuiClose:
  73. Gui, Hide
  74. SkinForm(0)
  75. ExitApp
  76. Return
  77.  
  78. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  79.     if(Param1 = Apply){
  80.         DllCall("LoadLibrary", str, DLL)
  81.         DllCall(DLL . "\USkinInit", Int,0, Int,0, AStr, SkinName)
  82.     }else if(Param1 = 0){
  83.         DllCall(DLL . "\USkinExit")
  84.         }
  85. }
  86. ;============ END SCRIPT BUTTON_MENU ==============
  87. #R::Reload
  88. #S::Suspend
  89. #P::Pause
  90. #ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement