README
¶
GoFileEncoder
🇫🇷 Vous parlez français ? Ouvrez LISEZMOI.md en français
Introduction
GoFileEncoder is a little file encoder that uses the XOR encryption. It is coded in Golang, and is compiled for several OSs (Windows®, Linux®, and soon macOS®).
I am not a pro in Go, so if you find a bug, or simply want to make a suggestion, I am totally open to issues, pull requests_ and to the discussion.
Table of Content
Building
Cloning
git clone https://github.com/eliotttak/GoFileEncoder
cd GoFileEncoder
Package dependencies tree
github.com/eliotttak/GoFileEncoder (this project)
|
+-- github.com/sqweek/dialog (for the file popups)
| |
| \_ github.com/TheTitanrain/w32 (indirect)
|
+-- golang.org/x/term (for the password asking)
| |
| \_ golang.org/x/sys (indirect)
|
\_ github.com/christianhujer/isheadless (to verify if there is a GUI)
Refer to the file go.mod for more details.
🛈 In go.mod, there can be an import for github.com/abdfnx/gosh. It was used only for my setup, and you shouldn't need it. It will disappear if you run
go mod tidy
.
Building dependencies
github.com/go-bindata/go-bindata/go-bindata/...
(to create the assets file)
Only for Windows®:
svg_to_ico
(Ortham/svg_to_ico) must be in$PATH
or%PATH%
(to convert the SVG icon into the ICO format)resourcehacker
(www.angusj.com/resourcehacker/#download) must be in$PATH
or%PATH%
(to add the icon to the executable)
Dependencies installing
go mod tidy
go install github.com/go-bindata/go-bindata/go-bindata/...
go get
You also have to install manually Resource Hacker and svg_to_ico
.
Compiling and creating assets package
In Bash
# You will maybe have to run 'chmod 744 build.sh'
./build.sh # You can add GOOS and GOARCH values, e.g. './build.sh linux amd64'
In Batch
rem You can add GOOS and GOARCH values, e.g. 'build.bat windows amd64'
build.bat
Running
In Bash
./bin/portables/GoFileEncoder_portable_linux_amd64 # You can write another OS or architecture.
In Batch
.\bin\portables\GoFileEncoder_portable_windows_amd64.exe
rem You can write another OS or architecture.
Translations
Install a language
Download a translation file (e.g. translate-en-GB.json
) and place it in the same folder as the executable.
Define the language to use
The choice of the language to use is partly automated. Here are the details:
1. No translation file installed
In this configuration, the language used will be British English (en-GB
).
2. Only one translation file installed
In this configuration, the translation file installed will be used.
3. Several (2 or more) translation files installed
In this configuration, each time the program is starting, the available languages will be listed, and you will be invited to choice one.
Create a translation file
File name
The file name must be in the format translate-ab-CD.json
, e.g. translate-en-GB.json
.
File content
The file is in the JSON
format.
The file is composed of five main parts:
general
contains the translations that will be used by at least 2 differents packages.Intro
contains the translations used only by the packagemain
.CommonThings
contains the translations used only by the packagecommonThings
.Encoding
contains the translations used only by the packageencoder
.Decoding
contains the translations used only by the packagedecoder
.
Usage
1. Encode or decode?
At first, run the program. It will ask you if you want to decode or encode a file :
Que voulez-vous faire ?
- Encoder un fichier (e)
- Décoder un fichier (d)
(e/d)>>>
If you want to encode a file, enter e, else, enter d. In all the cases, confirm with Enter.
2. Select a file
Then, it will ask you to press Enter to select a file. Do it, and a popup will aappear. Select your file, then confirm.
🛈 If you cancel, the popup will appear back twice, then at the 3rd, the message
"Trop de tentatives échouées"
(Too many failed attempts
) will be displayed and the program will be closed.
🛈 If your configuration don't include graphic interface, you will have to enter manually the absolute path to your file.
3. Enter the password
After it, you will be asked for a password. Enter it then confirm by pressing Enter.
⚠ If you choosed
Decode a file
, be careful to write the password correctly. If you misspell it by even one character, the file will be corrupted and no longer usable.
🛈 To ensure that your password remains confidential, it will not be displayed on your screen.
4. Choose the destination file
Then, the program will ask you to press Enter to choose the destination file. Do it, and a popup will aappear. Select the file to create, then confirm.
🛈 If you cancel, the popup will appear back twice, then at the 3rd, the message
"Trop de tentatives échouées"
(Too many failed attempts
) will be displayed and the program will be closed.
🛈 If your configuration don't include graphic interface, you will have to enter manually the absolute path to your file.
5. Wait...
The file is being encoded. Do not close the program.
6. All's done!
After a few seconds, the file is encoded or decoded. The programme closes automatically.
License
This software is distributed under the GNU GENERAL PUBLIC LICENSE version 3 (GNU GPL v3).