2024-08-31 20:55:52 +08:00
2024-08-31 15:12:24 +08:00
2024-08-31 20:55:52 +08:00
2024-08-31 15:12:24 +08:00
2024-08-31 15:12:24 +08:00
2024-08-31 20:55:52 +08:00
2024-08-31 15:12:24 +08:00
2024-08-31 17:32:15 +08:00

go-afero-encfs

go-afero-encfs is a afero encrypted fs implementation

In stage 1 we only encrypt file content, the file name is not encrypted.

In the future we are going to encrypt the file name also.


AES-CTR algorithm is show as: https://git.hatter.ink/hatter/simple-rust-tests/src/branch/master/__crypto/aes_ctr_test/src/main.rs

Algorithm is shown as below:

let key = <Your AES encryption key>;
let iv = <Random 8 bytes>;

let plaintext = <Plaintext bytes>;
let ciphertext = <plaintext.len() bytes>;
let plaintext_block_count = ceil(plaintext / 16);

for counter in 0..plaintext_block_count {
    let iv_and_counter = iv + counter.to_be_bytes();
    let encrytped_iv_and_counter = aes_encrypt(key, iv_and_counter);

    for i in 0..encrytped_iv_and_counter {
        ciphertext[counter * 16 + i] = encrytped_iv_and_counter[i] ^ plaintext[counter * 16 + i];
    }
}

Related projects:

Description
No description provided
Readme 73 KiB
Languages
Go 100%