Latest Questions tagged Cryptography

Browse all latest questions tagged Cryptography

Published 02 Oct, 2022
Java - Base64 encode/decode in ECC encrypt and decrypt

I want to test the ECC algorithm encrypt and decrypt. I write code to: Generate key pair (publickey and privatekey) ---> write them to file (maybe not secure but I just only test). Then using publi...

Published 07 Sep, 2022
Java - Why do people use bouncycastle instead of Java's built in JCE provider? What is the difference?

Why do people use bouncycastle instead of Java Cryptography Extension? What is the difference?

Published 13 Aug, 2022
Python - Python Cryptography export key to DER

In the past when using PyCrypto I was able to do the following to generate a fingerprint of a RSA public key: rsa_cipher = hashlib.sha1(rsa_cipher._key.expo...

Published 14 Aug, 2022
Python - basics of python encryption w/ hashlib sha1

I'm struggling to fully understand how encryption works and is coded, particularly with python. I'm just trying to get the basics down and create code in the simplest form. I'm going to be passing a...

Published 15 Sep, 2022
Java - error decrjavax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption

I am facing the following issue while working with Java cryptography. error decrjavax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used dur...

Published 10 Jun, 2022
Python - Python RSA Brute Force Check

I have an exercise to brute force a piece of text that has been encrypted with a very small key. The public key I have is (e = 5, n = 203). The text has been converted to ASCII, shifted a fixed number...

Published 01 May, 2022
Python - Decrypt MD5 hash

Is there any way to decrypt the encrypted MD5 string, given the key?

Published 21 Aug, 2022
Java - Decrypt the encrypted file content?

I am having a problem decrypting a file using RSA public key decryption. My process is to receive the xml file, encrypt the content, and write it back to the same file. Another function decrypts the c...

Published 03 May, 2022
Python - How to implement Fernet encryption with AES 256

I'm currently using Fernet encryption which uses AES 128 keys. However my client requires using AES 256. I'm not very familiar with cryptography but here is what I understood so far. Fernet needs a 2...

Published 16 Aug, 2022
Python - Decrypt Python cryptography fernet token in C#

I have written an encryption function in Python, which works fine. from cryptography.fernet import Fernet def Encryptor(password): key = b'MAKV2SPBNI99212' cipher_suite = Fernet(key) ciph...

Published 14 Aug, 2022
Python - How to sign a document in python with M2Crypto using particular padding technique?

I need to digitally sign some text in python using a private key stored in a .pem file. It seems like M2Crypto is the preferred way to do that these days, so that's what I'm using. I think I get mos...

Published 12 Aug, 2022
Python - RSA Encryption Padding issues between Python and Java

I am trying to RSA encrypt some data in python using a public key that was generated by a client in android. The encryption goes successfully (atleast there are no exceptions). However, when trying to...

Published 11 Aug, 2022
Python - Optimising multiplication modulo a small prime

I need to do the following operation many times: Take two integers a, b Compute a * b mod p, where p = 1000000007 and a, b are of the same order of magnitude as p My gut feeling is the naive resu...

Published 09 Aug, 2022
Python - TLS in Twisted Python - How to create server.pem?

I've just discovered Twisted in Python, and have been looking at the sample as found here: Just above the sample code, t...

Published 16 Apr, 2022
Javascript - Secure random numbers in javascript?

How do I generate cryptographically secure random numbers in javascript?