- Go
Original Image
Encrypted Image
Decrypted Image
- Clone the repository
- Run
go build -o build/GoPixEnc
to build & generate an executable file atbuild
folder - Run
go run .
to run the program without building
Important Variables
GOOS
for target OSGOARCH
for target architecture
Example
To build for current OS & architecture: go build -o build/GoPixEnc_vx.y.z_os_arch
To build for Windows: GOOS=windows GOARCH=amd64 go build -o build/GoPixEnc_vx.y.z_windows_arch.exe
To build for Linux: GOOS=linux GOARCH=amd64 go build -o build/GoPixEnc_vx.y.z_linux_arch
- Download the appropriate latest release from GitHub Releases
- Run the executable file
- Run the executable file
- Chose the image you want to encrypt from the file explorer or leave it empty to use the default image
- In choice menu, select
e
to encrypt image - Enter the password you want to use to encrypt the image
- It will generate a file named
encrypt.png
in the same directory as the executable file
- Run the executable file
- Chose the image you want to decrypt from the file explorer
- In choice menu, select
d
to decrypt image - Enter the password you used to encrypt the image
- It will generate a file named
decrypt.png
in the same directory as the executable file
- Create
images
folder if not exists
- File explorer UX improvement: Now, it will show the file explorer after encryption/decryption choice is made & file explorer will remain open until a file is selected
- Better error handling in file explorer
- Updated package versions
- Separate images folder
- Dialogue box to choose image
- Included example image in the repository
- Image can be image.png or image.jpg
- Updated README with new example images
- Fixed issue with multithreading of version 2.0.0
- New algorithm to generate random numbers for pixels
- Multithreading
Check note for more info
This version is not stable & accurate. Due to multithreading, some pixels are not being encrypted/decrypted properly
I'm generating random numbers for each pixel. Suppose if pixel 10 gets 5 as random number, 5 may/may not get 10 as its random number. Even though I'm keeping a history operation on pixels, if 5 gets 2 as its random number, and it's on different thread, it will swap 5 with 2, not 10 with 5. So, the image will be corrupted.
I'm thinking of using a different approach. Instead of generating random numbers for each pixel, I will generate n/2 random numbers for n pixels.
Suppose if I have 100 pixels, I will generate 50 random numbers from 51 to 100 and assign 0-50 to them. So that, if 55 gets 2 as its random number, 2 will get 55 as its random number. I'm still thinking about a better approach.
- Password now supports any ASCII value. In v1.0.0 only numbers were allowed as password
- Using
rand.New(rand.NewSource(seed))
instead of deprecatedrand.seed(seed)
- Fixed wrong output on decryption:
Done creating image decrypt.png
->Done creating image
- Can encrypt & decrypt images
- Multi-threading
- Better random number generation
- File explorer
- GUI