public-key-encryption

Contiki mote type creation error when trying to use libtomcrypt library (rsa public key generation)

情到浓时终转凉″ 提交于 2019-12-06 07:27:40
I am trying to work on RSA public key generation using libtomcrypt library for my school project. But I am unable to load the library in Cooja using Contiki OS. I tried to compile the file I need into an object file and load it in .csc file. This is the error message I got: se.sics.cooja.GUI$SimulationCreationException: Mote type creation error: Error when creating corecomm instance: Lib1 at se.sics.cooja.GUI.loadSimulationConfig(GUI.java:3440) at se.sics.cooja.GUI.loadSimulationConfig(GUI.java:3352) at se.sics.cooja.GUI.doLoadConfig(GUI.java:2397) at se.sics.cooja.GUI$4.run(GUI.java:636) at

InvalidKeySpecException using public key

眉间皱痕 提交于 2019-12-06 05:53:04
I'm desperately trying to encrypt a message using asymmetric public / private key cryptography on an Android. I'm on Windows and I've generated a public and private key using puttygen. I'm not sure what difference it makes but I've selected SSH-2 RSA. Here is the public key: AAAAB3NzaC1yc2EAAAABJQAAAQEAh63orUzl0UTd7jj0KNYJg1+kNnty0QHyJu0r Cajf5Kl7qWJaGXPfwsG8Qt3teafs5sv0JBSinab0s/5wfQmd1QPpXTMP93Wc4ucp 1VC/9B2o8XVi4fKoGTehB48yrSfI6KF2AIeASM1jUswydKxsuS4AS2mLGV/HuoKD huMfCsRc8qK5zGQfVCoZTbQ66Z1yKdAzxMUuGmiTp7pVsle/P/UGbm6yFiee5r1/ dOR2CDyR6CP09Jaj7KSGfGuwPryCXPjEce1oCbN/FlLHVb7T1B5f6xhq+oY+Ij13

Using RSA to protect license files

自古美人都是妖i 提交于 2019-12-06 04:28:56
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 license-file system? It is possible to recover a public key from a private key, so having the private key

RSA Encryption forceclosing before generating public/private keys

自古美人都是妖i 提交于 2019-12-06 01:47:57
I am trying to generate my first public/private key pair for an RSA encryption. This is my first time doing so but through looking at various tutorials and website i've decided to do so with the following code. Although my code does not give me errors, it force closes. Everything is posted including my imports, can sombody please help me understand why my code is not generating keys and giving me errors? And yes i did declare it in the AndroidManifest.xml file import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.math.BigInteger;

Android in-app billing signature verification in php server

混江龙づ霸主 提交于 2019-12-06 01:40:53
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 = openssl_get_publickey($cert); // state whether signature is okay or not $ok = openssl_verify($data,

How does two-way asymmetric encryption work?

好久不见. 提交于 2019-12-06 00:19:28
问题 Say we have Alice and Bob. Alice sends Bob a message she encrypted with Bob's public key. Bob is the only person who can decrypt it, using his private key. But how can he be certain the message came from Alice? Suppose he replies, encrypting his message using Alice's public key. Only Alice can decrypt the message. But how can she be certain it was sent by Bob? Would Alice have to add some kind of public hash to her message so bob can say "This definitely came from Alice?" 回答1: Bob has Alice's

Is it possible to prevent man-in-the-middle attack when using self-signed certificates?

时间秒杀一切 提交于 2019-12-05 22:35:47
问题 I'm not sure is similar question has been asked before (I couldn't find any), but is it possible to protect Client/Server from Man-In-The-Middle attack? I'm writing a Client application to communicate with Server. Communication will be SSLv3 based. I am OK with server's self-signed certificates, but worried about someone else generating same self-signed certificate in the same server name and pretend to be it. My Client application uses OpenSSL library. [Client and Server are thrift based, if

Final subtraction in montgomery modular multiplication for an RSA cryptosystem

懵懂的女人 提交于 2019-12-05 21:00:48
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 eliminate the need for the repetitive subtraction of the modulus at the end of the montgomery multiplication.

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

荒凉一梦 提交于 2019-12-05 20:45:36
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 65537: // Create key RsaKeyPairGenerator generator = new RsaKeyPairGenerator(); var param = new

Error importing public key using cryptoapi CryptImportKey

柔情痞子 提交于 2019-12-05 18:38:43
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,0xFB,0x38,0xBE,0x18,0xD7,0x8E,0x87,0xA0,0xE4,0x1B,0x9B,0x8F,0x73,0xA9,0x28,0xEE,0x0C,0xCE,0xE1,0xF6,0x73