{"id":21406845,"url":"https://github.com/ms-luf/quick.file.encryption","last_synced_at":"2025-10-30T10:19:29.829Z","repository":{"id":137505321,"uuid":"158741204","full_name":"MS-LUF/Quick.File.Encryption","owner":"MS-LUF","description":"a toolbox to encrypt automatically file in a folder (FileSystemWatcher) using Cryptographic Message Syntax format (CMS) and a public key (certificate)","archived":false,"fork":false,"pushed_at":"2019-05-15T22:05:20.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T17:17:30.575Z","etag":null,"topics":["certificate","cryptographic","powershell","powershell-module","powershell-script"],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MS-LUF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-22T19:09:40.000Z","updated_at":"2022-08-02T21:57:17.000Z","dependencies_parsed_at":"2023-03-30T05:34:16.294Z","dependency_job_id":null,"html_url":"https://github.com/MS-LUF/Quick.File.Encryption","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MS-LUF/Quick.File.Encryption","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MS-LUF%2FQuick.File.Encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MS-LUF%2FQuick.File.Encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MS-LUF%2FQuick.File.Encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MS-LUF%2FQuick.File.Encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MS-LUF","download_url":"https://codeload.github.com/MS-LUF/Quick.File.Encryption/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MS-LUF%2FQuick.File.Encryption/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270082401,"owners_count":24523721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificate","cryptographic","powershell","powershell-module","powershell-script"],"created_at":"2024-11-22T16:43:05.709Z","updated_at":"2025-10-30T10:19:24.782Z","avatar_url":"https://github.com/MS-LUF.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://www.lucas-cueff.com/files/gallery.png)\r\n# Quick.File.Encryption\r\na toolbox to encrypt (protect-cmsmessage) automatically file in a folder (FileSystemWatcher) using Cryptographic Message Syntax format (CMS) and a public key (certificate)\r\n\r\n(c) 2018-2019 lucas-cueff.com Distributed under Artistic Licence 2.0 (https://opensource.org/licenses/artistic-license-2.0).\r\n\r\n## Description\r\nThis toolbox can be used to watch (FileSystemWatcher - inotify) a folder and encrypt automatically new file created using the CMS format https://en.wikipedia.org/wiki/Cryptographic_Message_Syntax and a valid public key (OID and key usage speaking)\r\n\r\n## Note\r\nTo use this module you need Powershell Core or PowerShell 5 for Windows.\r\nYou need also a valid certificate (OID 1.3.6.1.4.1.311.80.1 aka DOCUMENT_ENCRYPTION), see https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/protect-cmsmessage?view=powershell-6\r\n- you can use my OpenSSL sample conf file to generate a DEV CA and generate valid user encryption certificate to test it :)\r\n\r\n## Documentation\r\nTo do ;)\r\n\r\n## Exported Functions and Alias\r\n### Functions\r\n- ConvertFrom-Base64ToBinaryFile\r\n- ConvertFrom-BinaryFileToBase64\r\n- Trace-FileSystemFolder                                                       \r\n\r\n## Use the toolbox\r\n### Encrypt all text file in your C:\\temp folder using test.cer public key\r\nUse Watch-And_Encrypt.ps1 with C:\\temp as TargetFolder parameter, c:\\temp2\\test.cer as TargetCertificate parameter and \"*.txt\" as FileFilter parameter\r\n```\r\n\tC:\\PS\u003e .\\Watch-And-AutoEncrypt.ps1 -TargetFolder C:\\temp -TargetCertificate c:\\temp2\\test.cer -FileFilter \"*.txt\"\r\n```\r\n### Encrypt all binaries file in your c:\\temp folder using test.cer public key\r\nUse Watch-And_Encrypt.ps1 with C:\\temp as TargetFolder parameter, c:\\temp2\\test.cer as TargetCertificate parameter , \"*.exe\" as FileFilter parameter and IsBinaryFile switch\r\n```\r\n\tC:\\PS\u003e .\\Watch-And-AutoEncrypt.ps1 -TargetFolder C:\\temp -TargetCertificate c:\\temp2\\test.cer -FileFilter \"*.exe\" -IsBinaryFile\r\n```\r\n### Result\r\nthe source file is copied and encrypted into *.enc file and source file is automatically removed after that.\r\n\r\n## Decrypt\r\nImport the QuickFileEncryption if you have encrypted binary (optional)\r\nImport the cetificate with the private key locally (and trust the AC linked also)\r\n### Non binary file\r\n```\r\n\tC:\\PS\u003e Unprotect-CmsMessage -Path C:\\temp\\your.txt.enc\r\n```\r\n### binary file\r\n```\r\n\tC:\\PS\u003e Unprotect-CmsMessage -Path C:\\temp\\your.exe.enc | ConvertFrom-Base64ToBinaryFile -OutputFilePath C:\\temp\\your.exe\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms-luf%2Fquick.file.encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fms-luf%2Fquick.file.encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms-luf%2Fquick.file.encryption/lists"}