Questions tagged [public-key-encryption]

An cryptographic scheme which uses two mathematically related keys; a public and a private key where a message encrypted with public key can only be decrypted with the private key and vice-versa.

The most important element of public key encryption is that the public and private keys are related in such a way that only the public key can be used to encrypt a message and only the matching private key can be used to decrypt it. In addition, it is practically impossible to derive the private key with only the knowledge of the public key. Public-key systems such as PGP, SSL and many others benefit from this mathematically well-defined behavior of public key encryption. It is important to note that public key encryption is mostly called asymmetric encryption because it uses two keys instead of one key as opposed to symmetric encryption.

1918 questions
0
votes
1 answer

Public / Private Key Cryptography for offline systems

Hi Crypto experts out there, are there any best practices around distributing an ecnrypted package to multiple end user systems, specially if the end system are offline ones? in context of assymetric crypto. is it must to create unique pub/pvt key…
0
votes
0 answers

Use /dev/input/mice to generate a RSA key in Python3

Here's my code so far. What I want to do is generate an RSA key based on the user's mouse movements. from Crypto.PublicKey import RSA def rand(leng): data = open("/dev/input/mice","rb").read(leng) return data key =…
0
votes
1 answer

How do password managers encrpty passwords that are shared with a group?

There are password managers that encrypt passwords and data on the client side before storing it on the server. I understand the Symmetric and Asymmetric Encryptions on a basic level. With Asymmetric Encryption, it requires the Public key of the…
0
votes
2 answers

Encrypting a POST variable using HTTPS against the same server - will it encrypt differently each time?

My understanding of Public Key Cryptography is that the word alleycat will be encrypted in to the same encrypted string each time if the same public key is used (which is my understanding of how HTTPS works for any given web server). Does this mean…
Callum
  • 435
  • 1
  • 4
  • 14
0
votes
0 answers

Why am I not getting the decrypted data when my input text size is less than 16 bytes using openssl EVP_OpenInit() api function?

I am trying to encrypt and Decrypt file using EVP apis. I am getting correct result when size is greater or equal to 16 bytes only. Here is my codes for the above stated problem. #include #include #include…
0
votes
1 answer

Node.js crypto.publicEncrypt: 'Error: error:0906D06C:PEM routines:PEM_read_bio:no start line'

I'm trying to use the public key encryption in crypto.js, I want to encrypt some message using publicEncrypt, and decrypt it with privateDecrypt. const crypto=require('crypto'); let alice=crypto.getDiffieHellman('modp14'); alice.generateKeys(); let…
0
votes
0 answers

Java RSA encryption faild

I am trying to encrypt some data using a string public key and its failing with the error : java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format my code is: public class Encryptor { public static…
Israel.z
  • 321
  • 2
  • 6
0
votes
0 answers

Exchanging publicKeys of RSA encryption method in an android chat application

I want to use RSA in a android chat application which works through WIFI-Direct. I should exchange public keys between server phone and client phone at the beginning of chat session. how should I do that? any framework or Library is greatly…
user5871360
0
votes
1 answer

Directory(Path) of Android Keystore in an android phone

KeyPairGenerator keyGen = KeyPairGenerator.getInstance(KeyProperties.KEY_ALGORITHM_EC, "AndroidKeyStore"); keyGen.initialize(new KeyGenParameterSpec.Builder( "Authentication_Key" + username, …
0
votes
0 answers

How can i generate RSA key for bigint?

I'm using the following program to generate an RSA key of 4 bytes length (unsigned long). So my question is how can i modify my program to work with big integers ? void keygen(unsigned long int e, unsigned long int p, unsigned long int q) { …
Radu
  • 73
  • 1
  • 3
  • 10
0
votes
1 answer

How can we programatically get public key from passphrase protected private key without creating an SSH connection?

I want to use Python to get public key from private key which is passphrase protected. When there is no passphrase we can easily get it by executing ssh-keygen -y -f id_rsa > id_rsa.pub in bash. But I was not able to find a command or a library…
0
votes
1 answer

Unable to decrypt binary file

I've been trying to encrypt docx file using GPG public key and go's openpgp library. It encrypts document but then I am unable to decrypt it using my private key. Already tried to do the same with plain text file and decryption worked without any…
sultan
  • 5,978
  • 14
  • 59
  • 103
0
votes
1 answer

Openssl cipher suite explanation

I want to use the cipher suite, TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA, for openssl in fips mode and I wan't to know the details for this. Looking at the source code in openssl 1.0.2k, I see it has the parameterss3_lib.c: /* Cipher C014 */ { …
hDan
  • 467
  • 4
  • 19
0
votes
2 answers

Can public key be used for decryption (verification) of the document encrypted (signed) using private key

In many websites and textbooks they say that public key is always used for encryption and private key is used for decryption.In RSA algorithm ,this is true.But in digital signatures,the sender signs(I believe that this is a somewhat similar to…
0
votes
1 answer

Digital signature when only one person has public/private key

Hello I have a scenarios where a client and a bank must communicate in a secure way and they must use electronic signature but only the bank has public/private key. How will the communication occur? Meaning how will they authenticate each other who…