Skip to content

pedroalbanese/sm4crypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SM4Crypt

ISC License GitHub downloads GoDoc Go Report Card GitHub go.mod Go version GitHub release (latest by date)

Command-line GM/T 0002-2012 SM4-GCM Encryption Tool

Usage of sm4crypt:
sm4crypt [-d] -p "pass" [-i N] [-s "salt"] -f <file.ext>
  -a string
        Additional Associated Data.
  -d    Decrypt instead of Encrypt.
  -f string
        Target file. ('-' for STDIN)
  -i int
        Iterations. (for PBKDF2) (default 1024)
  -k string
        128-bit key to Encrypt/Decrypt.
  -p string
        Password-based key derivation function2.
  -r    Generate random 128-bit cryptographic key.
  -s string
        Salt. (for PBKDF2)

Example of encryption/decryption:

./sm4crypt -k $128bitkey -f plaintext.ext > ciphertext.ext
./sm4crypt -d -k $128bitkey -f ciphertext.ext > plaintext.ext

License

This project is licensed under the ISC License.

Industrial-Grade Reliability. Copyright (c) 2020-2021 ALBANESE Research Lab.