Category : cryptography

I’m currently writing a program that takes any plaintext as input and encrypts it using AES and RSA and then decrypts the corresponding ciphertext. I am currently having an issue when grabbing the RSA encrypted value from the GUI entry and trying to decrypt it, first off the value comes as a string and I ..

Read more

I have this program that accepts a double-quoted string as command line argument and prints a base64-encoded forged signature of that input string. from Crypto.Hash import SHA from roots import * import sys message_in = sys.argv[1] # add the initial padding and such forged_sig = 0x0001FF003021300906052B0E03021A05000414 hash_message = SHA.new(message).hexdigest() hash_bits = 160 forged_sig = forged_sig ..

Read more

#[macro_use] extern crate cpython; use cpython::{Python, PyResult}; // file: main.rs use concrete::*; fn get_cypher(_py: Python, val: &f64) -> PyResult<()> { // generate a secret key let secret_key = LWESecretKey::new(&LWE128_1024); // encoder let encoder = Encoder::new(100., 210., 8, 0)?; // encode and encrypt let message = 106.276; let mut ciphertext = LWE::encode_encrypt(&secret_key, message, &encoder)?; // addition ..

Read more

Context: i’m working on making a python version of paymentmethodtoken from the google tink librarie to work with gpay messages. For that i use only python and PyCryptodome. With that said i’m currently trying to implement an equivalent of the kem function: private byte[] kem(JsonObject json, final byte[] contextInfo) throws GeneralSecurityException { int demKeySize = ..

Read more