- ๐ currently building oneramp a crypto on and offramping solution for subSaharan Africa.
- ๐ค Ex Intern at Nethermind, Was focused on core ethereum development
- ๐ looking to work with companies using the blockchain to impact the world
- ๐ญ Looking also to contribute more to opensource.
- ๐ฑ Iโm currently perfecting my solidity, Writing it in low level assembly.
- ๐ฏ Iโm looking to collaborate on EVM blockchain projects.
- ๐ฌ Ask me about solidity
- โก Fun fact: I love debugging
- ๐ซ How to reach me: [email protected]
aes_activity's Introduction
aes_activity's People
aes_activity's Issues
Implement XOR first block with plaintext of the next block before it is encrypted
@kavehtehrani
Checking this implementation, your previous_ciphertext_block
ungoes a double encryption in the first round. Also do not see where we XOR
the previous block with the block bytes.
fn cbc_encrypt(plain_text: Vec<u8>, key: [u8; BLOCK_SIZE]) -> Vec<u8> {
// Remember to generate a random initialization vector for the first block.
let padded_text = pad(plain_text);
let blocks = group(padded_text);
let mut rng = rand::thread_rng();
let mut iv: [u8; BLOCK_SIZE] = [0; BLOCK_SIZE];
rng.fill(&mut iv);
// encrypt the iv with the key
let mut previous_ciphertext_block = aes_encrypt(iv, &key);
let mut encrypted_blocks: Vec<[u8; BLOCK_SIZE]> = Vec::new();
for block in blocks.iter() {
previous_ciphertext_block = aes_encrypt(*block, &previous_ciphertext_block);
encrypted_blocks.push(previous_ciphertext_block);
}
let mut ciphertext = un_group(encrypted_blocks);
// Prepend the IV to the ciphertext
ciphertext.splice(0..0, iv.iter().cloned());
ciphertext
}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.