在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:elasticdog/transcrypt开源软件地址:https://github.com/elasticdog/transcrypt开源编程语言:Shell 100.0%开源软件介绍:transcryptA script to configure transparent encryption of sensitive files stored in a Git repository. Files that you choose will be automatically encrypted when you commit them, and automatically decrypted when you check them out. The process will degrade gracefully, so even people without your encryption password can safely commit changes to the repository's non-encrypted files. transcrypt protects your data when it's pushed to remotes that you may not directly control (e.g., GitHub, Dropbox clones, etc.), while still allowing you to work normally on your local working copy. You can conveniently store things like passwords and private keys within your repository and not have to share them with your entire team or complicate your workflow. Overviewtranscrypt is in the same vein as existing projects like git-crypt and git-encrypt, which follow Git's documentation regarding the use of clean/smudge filters for encryption. In comparison to those other projects, transcrypt makes substantial improvements in the areas of usability and safety.
Salt GenerationThe decryption -> encryption process on an unchanged file must be deterministic for everything to work transparently. To do that, the same salt must be used each time we encrypt the same file. Rather than use a static salt common to all files, transcrypt first has OpenSSL generate an HMAC-SHA256 cryptographic hash-based message authentication code for each decrypted file (keyed with a combination of the filename and transcrypt password), and then uses the last 16 bytes of that HMAC for the file's unique salt. When the content of the file changes, so does the salt. Since an HMAC has been proven to be a PRF, this method of salt selection does not leak information about the original contents, but is still deterministic. UsageThe requirements to run transcrypt are minimal:
...and optionally:
You also need access to the transcrypt script itself. You can add it directly to your repository, or just put it somewhere in your $PATH:
Installation via PackagesA number of packages are available for installing transcrypt directly on your system via its native package manager. Some of these packages also include man page documentation as well as shell auto-completion scripts.
...see the INSTALL document for more details. Initialize an Unconfigured Repositorytranscrypt will interactively prompt you for the required information, all you have to do run the script within a Git repository:
If you already know the values you want to use, you can specify them directly
using the command line options. Run Designate a File to be EncryptedOnce a repository has been configured with transcrypt, you can designate for files to be encrypted by applying the "crypt" filter, diff, and merge to a pattern in the top-level .gitattributes config. If that pattern matches a file in your repository, the file will be transparently encrypted once you stage and commit it:
The .gitattributes file should be committed and tracked along with everything else in your repository so clones will be aware of what is encrypted. Make sure you don't accidentally add a pattern that would encrypt this file :-)
Listing the Currently Encrypted FilesFor convenience, transcrypt also adds a Git alias to allow you to list all of the currently encrypted files in a repository:
Alternatively, you can use the
You can also use this to verify your .gitattributes patterns when designating
new files to be encrypted, as the alias will list pattern matches as long as
everything has been staged (via After committing things, but before you push to a remote repository, you can validate that files are encrypted as expected by viewing them in their raw form:
The
Initialize a Clone of a Configured RepositoryIf you have just cloned a repository containing files that are encrypted, you'll
want to configure transcrypt with the same cipher and password as the origin
repository. The owner of the origin repository can dump the credentials for you
by running the
Once transcrypt has stored the matching credentials, it will force a checkout of any exising encrypted files in order to decrypt them. RekeyingPeriodically, you may want to change the encryption cipher or password used to encrypt the files in your repository. You can do that easily with transcrypt's rekey option:
After rekeying, all clones of your repository should flush their transcrypt credentials, fetch and merge the new encrypted files via Git, and then re-configure transcrypt with the new credentials.
Command Line OptionsCompletion scripts for both Bash and Zsh are included in the contrib/ directory.
CaveatsOverheadThe method of using filters to selectively encrypt/decrypt files does add some overhead to Git by regularly forking OpenSSL processes and removing Git's ability to efficiently cache file changes. That said, it's not too different from tracking binary files, and when used as intended, transcrypt should not noticeably impact performance. There are much better options if your goal is to encrypt the entire repository. LocalhostNote that the configuration and encryption information is stored in plain text within the repository's .git/config file. This prevents them from being transferred to remote clones, but they are not protected from inquisitive users on your local machine. For safety, you may prefer to only have the credentials stored when actually
updating encrypted files, and then flush them with Cipher SelectionLast up, regarding the default cipher choice of
I'm contemplating if transcrypt should append an HMAC to the Licensetranscrypt is provided under the terms of the MIT License. Copyright © 2014-2020, Aaron Bull Schaefer. ContributingLinting and formattingPlease use:
TestsTests are written using bats-core version of "Bash Automated Testing System" and stored in the tests/ directory. To run the tests:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论