vsql_crypto brings a pgcrypto-compatible set of functions to MySQL, built
on OpenSSL. It covers four jobs: hashing a value, signing a payload, encrypting
a column, and storing a password you can verify later.
Install
vsql_crypto.veb is already in the server’s lib/veb/ directory if you
installed VillageSQL with the install script, the Docker image, or a release
tarball. Install it into the server with one statement:
What it adds
The functions marked binary return raw bytes, so wrap them in
HEX() to read
them. The rest return text.
Example
Sign a payload and check the signature against a tampered copy:gen_salt supports the PBKDF2 family only. Asking for bf, md5, or des
returns NULL, and crypt with a NULL salt returns NULL, so bcrypt hashes
written by pgcrypto cannot be verified here.See also
- Hashing data in MySQL — which algorithm to use and what to store
- Signing payloads with HMAC — webhook signatures and token verification
- Encrypting columns — key handling and what encryption does not protect
- Install extensions — how
INSTALL EXTENSIONworks and where the server looks for a bundle - Available extensions — the full catalog
- villagesql/vsql-crypto — source, build instructions, and the known limitations

