public-key-encryption

Need to create DHPublicKey from y, p, g as BigIntegers

你说的曾经没有我的故事 提交于 2019-12-08 04:18:04
问题 I need a DHPublicKey to encrypt some data. Therefore I have been provided with all the needed parameters as BigIntegers (y, p, g). Unfortunately I don't see a straight way for creating a public key object from these parameters that would fit the DHPublicKey interface. Any idea? 回答1: KeyFactory keyFactory; KeyPairGenerator kpg; DHPublicKey originalDhPubKey, fromSpecsDhPubKey; DHPublicKeySpec dhPubKeySpecs; KeyPair kp; BigInteger p, g, y; // generate a DH key pair kpg = KeyPairGenerator

RSA Encryption public key?

吃可爱长大的小学妹 提交于 2019-12-08 04:11:14
问题 How can i create RSA encryption public key from 'Modulus' and 'Exponent' in iOS.? I have created public key from keychain. is it possible from string 'Modulus' and 'Exponent' values? 回答1: See this answer over here https://stackoverflow.com/a/10643894/584616 https://github.com/StCredZero/SCZ-BasicEncodingRules-iOS SCZ-BasicEncodingRules-iOS Implementation of Basic Encoding Rules to enable import of RSA keys to iOS KeyChain using exponent. Code targets iOS 5 with ARC. Let's say you already have

PHP OpenSSL - openssl_private_encrypt crashes webpage

穿精又带淫゛_ 提交于 2019-12-08 03:39:56
问题 This has been reported at bugs.php.net. If I replace libeay32.dll and ssleay32.dll in xampp/apache/bin with the same files in xampp/php/ then it works but I CANNOT use SSL I need to use SSL, has anyone been able to resolve this? I am using OpenSSL library in PHP (5.4.7) on XAMPP (1.8.1) for encryption, decryption, etc. I am also using SSL on localhost. I am able to create the private-public key pair using openssl_pkey_new() method and generate the certificate as well. But when I try to access

Javascript RSA decryption using private key

≯℡__Kan透↙ 提交于 2019-12-08 02:42:25
Hello I have this script that I set in Javascript : <!DOCTYPE html> <html lang="en"> <head> <script src="jquery-1.7.2.min.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript" src="jsbn.js"></script> <script language="JavaScript" type="text/javascript" src="rsa.js"></script> <script language="JavaScript"> function encryptData(){ var pem ="-----BEGIN PUBLIC KEY-----\ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+tii3IwzHa4i142kAB0dRVXoXA2Q8oF48UgMA\ AV54+JDED5iVyJK1s7J/xGi4U3+9sRoraE7bS19Nihs5DuYa0gsbKs/5jXOtKiw94fAtMyJTcX0d\ SzZhJKcX9vEzI27Hdu1rNFY64Ixz3KjrG1N

Using RSA to protect license files

左心房为你撑大大i 提交于 2019-12-08 01:56:59
问题 I want to use RSA to protect license files in an application. The idea is as follows: Create a license file (plaintext). Create an RSA-keypair. Use the public key to encrypt the license file. Put the private key in the binary of the application. The application can then decode the license file and start running. The thing is that I have to ship the private key with my application. Is that a problem if I keep the public key secret? If not, what other good (enough) schemes exist to create a

Retrieve ECC Public Key from Base64 encoded string

浪尽此生 提交于 2019-12-07 17:33:41
问题 I've been trying to create an instance of java.security.PublicKey using a Base64 encoded ECC public key. MainActivity.java @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); try { byte[] data = decodePublicKey("AsIAEFjzIcX+Kvhe8AmLoGUc8aYAEAwf5ecREGZ2u4RLxQuav/A="); PublicKey publicKey = loadPublicKey("secp128r1", data); Log.d(TAG, publicKey.toString()); } catch (SQLException | IOException |

Final subtraction in montgomery modular multiplication for an RSA cryptosystem

强颜欢笑 提交于 2019-12-07 16:18:09
问题 I'm confused about how one might supposedly bypass the final subtraction of the modulus in radix-2 montgomery modular multiplication, when used in a modular exponentiation algorithm. The following two papers put forward the conditions for bypassing the subtraction. Montgomery Exponentiation with no Final Subtractions: Improved Results Montgomery Multiplication Needs no Final Subtractions I don't understand exactly what is required in terms of the "preprocessing and postprocessing" to

RSA Public exponent defaults to 65537. What should this value be? What are the impacts of my choices?

a 夏天 提交于 2019-12-07 15:04:02
问题 I'm creating unit tests for software that may encounter different exponent sizes. (see section 3.3.1 of this RFC) How can I use Bouncy Castle, or any other C# library to generate a RSA key pair that doesn't have a key size of 65537. If the answer is that I can directly modify this, as long as I update the private key as well, what specific changes (or re-computation) should I make for the public and private key? Here is the sample code that I'm using to create the key with the exponent of

Error importing public key using cryptoapi CryptImportKey

吃可爱长大的小学妹 提交于 2019-12-07 15:02:40
问题 I want to import public key blob to a CSP. but error occurred. BYTE pbData[] ={0xEB,0x2A,0x38,0x56,0x86,0x61,0x88,0x7F,0xA1,0x80,0xBD,0xDB,0x5C,0xAB,0xD5,0xF2,0x1C,0x7B,0xFD,0x59,0xC0,0x90,0xCB,0x2D,0x24,0x5A,0x87,0xAC,0x25,0x30,0x62,0x88,0x27,0x29,0x29,0x3E,0x55,0x06,0x35,0x05,0x08,0xE7,0xF9,0xAA,0x3B,0xB7,0x7F,0x43,0x33,0x23,0x14,0x90,0xF9,0x15,0xF6,0xD6,0x3C,0x55,0xFE,0x2F,0x08,0xA4,0x9B,0x35,0x3F,0x44,0x4A,0xD3,0x99,0x3C,0xAC,0xC0,0x2D,0xB7,0x84,0xAB,0xBB,0x8E,0x42,0xA9,0xB1,0xBB,0xFF

Android in-app billing signature verification in php server

爷,独闯天下 提交于 2019-12-07 13:53:16
问题 I am working on the IAB v3 in my android application. After every succes purchase, I want my app to send back the sign data and signature to my php server for verification by the public key generated by google developer console. I found the following code. <?php // $data and $signature are assumed to contain the data and the signature // fetch public key from certificate and ready it $fp = fopen("/src/openssl-0.9.6/demos/sign/cert.pem", "r"); $cert = fread($fp, 8192); fclose($fp); $pubkeyid =