### Create and open encrypted database files with hex encoded key Source: https://github.com/mutecomm/go-sqlcipher/blob/master/README.md This example demonstrates how to create and open encrypted database files using a hex-encoded 32-byte key and specifying the cipher page size. ```go key := "2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99" dbname := fmt.Sprintf("db?_pragma_key=x'%s'&_pragma_cipher_page_size=4096", key) db, _ := sql.Open("sqlite3", dbname) ``` -------------------------------- ### Create and open encrypted database files with passphrase Source: https://github.com/mutecomm/go-sqlcipher/blob/master/README.md This example shows how to open encrypted database files using a passphrase directly, leveraging SQLCipher's key derivation function. It highlights the importance of URL encoding the passphrase. ```go key := url.QueryEscape("secret") dbname := fmt.Sprintf("db?_pragma_key=%s&_pragma_cipher_page_size=4096", key) db, _ := sql.Open("sqlite3", dbname) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.