Information Security 4 min read

Dongle: A Lightweight, Semantic, Developer‑Friendly Go Library for Encoding, Decoding, and Cryptographic Operations

Dongle is a lightweight, Go-based library offering extensive encoding/decoding and cryptographic functions—including various hash, HMAC, and symmetric/asymmetric algorithms—along with recent updates such as tea‑mode support, empty‑string padding, and code restructuring, and is featured in the awesome‑go collection.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
Dongle: A Lightweight, Semantic, Developer‑Friendly Go Library for Encoding, Decoding, and Cryptographic Operations

Dongle is a lightweight, semantic, and developer‑friendly Go library that provides a wide range of encoding/decoding and encryption/decryption capabilities.

It has been included in the awesome‑go collection, and its source code is available at github.com/golang-module/dongle and gitee.com/golang-module/dongle .

Update Log

Added support for encrypting/decrypting ultra‑long text with tea when the plaintext exceeds 8 bytes, using empty‑string padding for segmented encryption.

Added support for the Empty padding mode.

Replaced the SM3 implementation from github.com/tjfoc/gmsm/sm3 with github.com/emmansun/gmsm/sm3 .

Moved the encrypt method from encrypter.go to cipher.go and the decrypt method from decrypter.go to cipher.go .

Removed the error types invalidTeaSrcError , invalidModeError , and invalidPaddingError .

Feature List

Hex encode/decode

Base16 encode/decode

Base32 encode/decode

Base45 encode/decode

Base58 encode/decode

Base62 encode/decode

Base64 encode/decode

Base64URL encode/decode

SafeURL encode/decode

Base85 encode/decode

Base91 encode/decode

Base100 encode/decode

Morse code encode/decode

MD2, MD4, MD5 hash

SHA‑1, SHA‑224, SHA‑256, SHA‑384, SHA‑512, SHA‑3 (224/256/384/512) hash

SHAKE128, SHAKE256 hash

RIPEMD‑160 hash

Blake2b (256/384/512) and Blake2s‑256 hash

HMAC variants for MD2, MD4, MD5, SHA‑1/224/256/384/512, SHA‑3, RIPEMD‑160, SM3

RC2, RC4, RC5, RC6 encrypt/decrypt

Tea and XTea encrypt/decrypt

AES, Blowfish, DES, 3DES encrypt/decrypt

RSA, ECC, SM2, SM3, SM4, SM7, SM9 encrypt/decrypt

Bcrypt, Ed25519, RSA, DSA sign/verify

GoencodingEncryptioninformation securitylibrarycryptography
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.