Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Added Encryption to the project and updated the readme #73

Open
mitmelon wants to merge 64 commits into tmarois:master
base: master
Choose a base branch
Loading
from mitmelon:1.0

Conversation

Copy link

@mitmelon mitmelon commented Jan 25, 2023

(11) Encryption Added

  • 🌟 Added Encryption mechanism to the document. You can now encrypt and decrypt all your documents by passing an encryption array to the config settings as shown below;
require_once __DIR__."/vendor/autoload.php";
/**
 * @settings array $encryption
 * @param key_storage_path - The path to where your encryption keys are stored
 * @key_name - The name of your key which points to the name of the key file (Store this name in your database)
 */
$db = new \Filebase\Database([
 'dir' => __DIR__.'/databases',
 'encryption' => array('key_storage_path' => __DIR__.'/encrypter', 'key_name' => 'test')
]);
$db->flush(true);
$user = $db->get(uniqid());
$user->name = 'John';
$user->email = 'john@example.com';
$user->save();
$db->where('name','=','John')->andWhere('email','==','john@example.com')->select('email')->results();
$result_from_cache = $db->where('name','=','John')->andWhere('email','==','john@example.com')->select('email')->results();
print_r($result_from_cache);

The above will encrypt your document when creating and decrypt it when fetching or quering. Please note that its required that you have the extension Sodium installed to use the encryption mechanism.

timothymarois and others added 30 commits August 16, 2018 23:18
...ts() change indexes from chronological integers to document Id. Adding the ID within the array key allows a reference the original document.
...tDocuments() change indexes from chronological integers to document Id. Adding the ID within the array key allows a reference the original document."
This reverts commit 1e413bb.
...ndling
Json format: refactor error handling + add JSON_UNESCAPED_UNICODE
*new_feature: delete items with custom filter
timothymarois and others added 30 commits February 22, 2019 23:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /