From 7c4c014b826744c398fb953acad59ee51aa8018c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=80=D0=B0=D1=81=D0=B8=D0=BC=D0=B8=D1=80=20=D0=91?= =?UTF-8?q?=D0=B5=D1=80=D0=BE=D0=B2?= Date: Sat, 3 Jan 2026 12:38:08 +0200 Subject: [PATCH] Fixed som typos and wrappings in sqlite3_func_crypt.go documentation. --- sqlite3_func_crypt.go | 46 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/sqlite3_func_crypt.go b/sqlite3_func_crypt.go index bd9a3bc09..5a8cd36c7 100644 --- a/sqlite3_func_crypt.go +++ b/sqlite3_func_crypt.go @@ -11,43 +11,41 @@ import ( "crypto/sha512" ) -// This file provides several different implementations for the -// default embedded sqlite_crypt function. -// This function is uses a caesar-cypher by default -// and is used within the UserAuthentication module to encode -// the password. +// This file provides several different implementations for the default +// embedded sqlite_crypt function. This function uses a caesar-cypher by +// default and is used within the UserAuthentication module to encode the +// password. // // The provided functions can be used as an overload to the sqlite_crypt // function through the use of the RegisterFunc on the connection. // -// Because the functions can serv a purpose to an end-user -// without using the UserAuthentication module -// the functions are default compiled in. +// Because the functions can serve a purpose to an end-user without using the +// UserAuthentication module the functions are default compiled in. // // From SQLITE3 - user-auth.txt // The sqlite_user.pw field is encoded by a built-in SQL function -// "sqlite_crypt(X,Y)". The two arguments are both BLOBs. The first argument -// is the plaintext password supplied to the sqlite3_user_authenticate() -// interface. The second argument is the sqlite_user.pw value and is supplied +// "sqlite_crypt(X,Y)". The two arguments are both BLOBs. The first argument is +// the plain-text password supplied to the sqlite3_user_authenticate() +// interface. The second argument is the sqlite_user.pw value and is supplied // so that the function can extract the "salt" used by the password encoder. -// The result of sqlite_crypt(X,Y) is another blob which is the value that -// ends up being stored in sqlite_user.pw. To verify credentials X supplied -// by the sqlite3_user_authenticate() routine, SQLite runs: +// The result of sqlite_crypt(X,Y) is another blob which is the value that ends +// up being stored in sqlite_user.pw. To verify credentials X supplied by the +// sqlite3_user_authenticate() routine, SQLite runs: // // sqlite_user.pw == sqlite_crypt(X, sqlite_user.pw) // // To compute an appropriate sqlite_user.pw value from a new or modified -// password X, sqlite_crypt(X,NULL) is run. A new random salt is selected -// when the second argument is NULL. +// password X, sqlite_crypt(X,NULL) is run. A new random salt is selected when +// the second argument is NULL. // -// The built-in version of of sqlite_crypt() uses a simple Caesar-cypher -// which prevents passwords from being revealed by searching the raw database -// for ASCII text, but is otherwise trivally broken. For better password -// security, the database should be encrypted using the SQLite Encryption -// Extension or similar technology. Or, the application can use the -// sqlite3_create_function() interface to provide an alternative -// implementation of sqlite_crypt() that computes a stronger password hash, -// perhaps using a cryptographic hash function like SHA1. +// The built-in version of of sqlite_crypt() uses a simple Caesar-cypher which +// prevents passwords from being revealed by searching the raw database for +// ASCII text, but is otherwise trivally broken. For better password security, +// the database should be encrypted using the SQLite Encryption Extension or +// similar technology. Or, the application can use the +// sqlite3_create_function() interface to provide an alternative implementation +// of sqlite_crypt() that computes a stronger password hash, perhaps using a +// cryptographic hash function like SHA1. // CryptEncoderSHA1 encodes a password with SHA1 func CryptEncoderSHA1(pass []byte, hash any) []byte {