Advertisement
Najeebsk

OPENSSL-SELECTED-FILE-ENCRYPT-DECRYPT.ahk

Jan 26th, 2024 (edited)
1,136
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-25-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, Button, x10 y10 w100 h30 gEncrypt, Encrypt Files
  19. Gui, Add, Button, x120 y10 w100 h30 gDecrypt, Decrypt Files
  20. Gui, Show, , File Encryption Tool
  21. return
  22.  
  23. Encrypt:
  24.    Gui, Submit, NoHide
  25.     ; Get the list of files to encrypt
  26.     FileSelectFile, FilesToEncrypt, 3,, Select files to encrypt, (*.*)|*.*
  27.  
  28.     ; Check if the user selected any files
  29.     if (FilesToEncrypt) {
  30.         ; Use OpenSSL to encrypt the files
  31.         RunWait, DATA\openssl.exe enc -aes-256-cbc -salt -in %FilesToEncrypt% -out encrypted_files.enc
  32.  
  33.         ; Provide feedback to the user
  34.         MsgBox, Encryption complete. Output saved to encrypted_files.enc.
  35.     } else {
  36.         MsgBox, No files selected for encryption.
  37.     }
  38. return
  39.  
  40. Decrypt:
  41.    Gui, Submit, NoHide
  42.     ; Get the file to decrypt
  43.     FileSelectFile, EncryptedFile, 1,, Select file to decrypt, (*.enc)|*.enc
  44.  
  45.     ; Check if the user selected any file
  46.     if (EncryptedFile) {
  47.         ; Use OpenSSL to decrypt the file
  48.         RunWait, DATA\openssl.exe enc -aes-256-cbc -d -in %EncryptedFile% -out decrypted_files.mp4
  49.  
  50.         ; Provide feedback to the user
  51.         MsgBox, Decryption complete. Output saved to decrypted_files.
  52.     } else {
  53.         MsgBox, No file selected for decryption.
  54.     }
  55. return
  56.  
  57. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58. GetOut:
  59. ;GuiClose:
  60. Gui, Hide
  61. SkinForm(0)
  62. ExitApp
  63. Return
  64.  
  65. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  66.     if(Param1 = Apply){
  67.         DllCall("LoadLibrary", str, DLL)
  68.         DllCall(DLL . "\USkinInit", Int,0, Int,0, AStr, SkinName)
  69.     }else if(Param1 = 0){
  70.         DllCall(DLL . "\USkinExit")
  71.         }
  72. }
  73. ;============ END SCRIPT BUTTON_MENU ==============
  74. #R::Reload
  75. #S::Suspend
  76. #P::Pause
  77. #ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement