public-key-encryption

OpenSSL Sign and Verify in C with RAW EC generated Keys

江枫思渺然 提交于 2020-06-26 12:26:29
问题 I generate my EC private key as random number and my EC public key as the multiplication of the generator for the random number. Now I would to use these keys to sign and verify a message, but the operation about the verification fails. Do you have any hint to solve this problem? I'm using OpenSSL 1.0.0 for some constraints. I cannot switch the new one. #include <openssl/ec.h> #include <openssl/rand.h> #include <openssl/bn.h> #include <openssl/sha.h> #include <openssl/evp.h> #include <openssl

Java - Public-private key encryption - how to calculate private key in RSA

人走茶凉 提交于 2020-04-13 18:14:28
问题 I worked on a code for an RSA algorithm and it returns the incorrect number, which happens to be huge. I am sure I coded everything right except for one line I was not sure about. I did not know how to solve for the private key in the RSA, and just winged it (I saw someone code d = e.modInverse(m); where d is the private key, e is the public key, and m is (p-1)*(q-1). I dont understand how the modInverse method works though. long story short, how do you actually solve for the 'd' without

Java - Public-private key encryption - how to calculate private key in RSA

烈酒焚心 提交于 2020-04-13 18:14:13
问题 I worked on a code for an RSA algorithm and it returns the incorrect number, which happens to be huge. I am sure I coded everything right except for one line I was not sure about. I did not know how to solve for the private key in the RSA, and just winged it (I saw someone code d = e.modInverse(m); where d is the private key, e is the public key, and m is (p-1)*(q-1). I dont understand how the modInverse method works though. long story short, how do you actually solve for the 'd' without

Trying to encrypt a random key for password reset functionality

北城以北 提交于 2020-01-25 10:06:30
问题 I am trying to encrypt a random token to be stored in the user table when a user uses the forgot password field by entering their username. It will also send out an e-mail with a url to the change user password page. This url will have a query string param called 'key'. i.e. www.mysite.com/Changepassword?key=xfsdfsdffsdfiughjksdf . Once the user clicks the link and they are on this page. I have a function that will get a user by ResetToken. If it finds a user then proceed. I need advice on a

Trying to encrypt a random key for password reset functionality

痞子三分冷 提交于 2020-01-25 10:05:29
问题 I am trying to encrypt a random token to be stored in the user table when a user uses the forgot password field by entering their username. It will also send out an e-mail with a url to the change user password page. This url will have a query string param called 'key'. i.e. www.mysite.com/Changepassword?key=xfsdfsdffsdfiughjksdf . Once the user clicks the link and they are on this page. I have a function that will get a user by ResetToken. If it finds a user then proceed. I need advice on a

Use of BigInteger.isProbablePrime() to generate cryptographically secure primes

纵然是瞬间 提交于 2020-01-24 20:41:06
问题 Can you use BigInteger.isProbablePrime() to generate cryptographically secure primes? What certainty is necessary for them to be "secure"? 回答1: I do not hold a degree in crypto, so take this with a grain of salt. You have two major areas of concern here: Your primes need to be unpredictably random. This means that you need to use a source such as SecureRandom to generate your primes. No matter how sure of your primality, if they are predictable, the entire cryptosystem fails to meet its goal.

SSH IdentitiesOnly=yes forwarding all my keys

假如想象 提交于 2020-01-14 05:54:07
问题 I cannot for the life of me figure out why my SSH config is forwarding the wrong key. I have two keys, we'll call them home_rsa and work_rsa . I have done the following: eval `ssh-agent` ssh-add -K ~/.ssh/home_rsa ssh-add -K ~/.ssh/work_rsa Here is my ~/.ssh/config file: Host home ForwardAgent yes HostName home.com IdentityFile ~/.ssh/home_rsa IdentitiesOnly yes User home Host work ForwardAgent yes HostName work.com IdentitiesOnly yes IdentityFile ~/.ssh/work_rsa User work Host bitbucket

How do I use RSACryptoServiceProvider to decrypt, given that I only have p, q, d and u?

南笙酒味 提交于 2020-01-14 03:07:36
问题 I am creating a simple client app to experiment with Mega and I am having trouble wrapping my head around the way RSA is used. Let's take, for example, the decryption of the session ID - this is one of the first things that must be done in order to log in. The API provides me the following RSA data: p (1024 bits) q (1024 bits) d (2044 bits) u (1024 bits) To start with, I do not know what "u" stands for. I see from code that it is calculated by modinverse(p, q) - is this what is commonly

Encrypting string in javascript and decryption in java

大城市里の小女人 提交于 2020-01-12 10:07:35
问题 I would like to know if someone know any library to do encryption in javascript and decryption in java. I have already tried many API, But getting not not getting same values in java. I want public-private key encryption and hence try to use RSA. Few i have used are: http://www-cs-students.stanford.edu/~tjw/jsbn/ http://ats.oka.nu/titaniumcore/js/crypto/readme.txt http://www.ohdave.com/rsa/ Few thing i checked, javascript breaks string into small chunks and then encrypt them which make cipher

Encrypting string in javascript and decryption in java

倖福魔咒の 提交于 2020-01-12 10:06:26
问题 I would like to know if someone know any library to do encryption in javascript and decryption in java. I have already tried many API, But getting not not getting same values in java. I want public-private key encryption and hence try to use RSA. Few i have used are: http://www-cs-students.stanford.edu/~tjw/jsbn/ http://ats.oka.nu/titaniumcore/js/crypto/readme.txt http://www.ohdave.com/rsa/ Few thing i checked, javascript breaks string into small chunks and then encrypt them which make cipher