public-key-encryption

Generating a public/private key pair using an initial key

不羁的心 提交于 2019-12-24 00:32:44
问题 I'm looking for a method that enables a user to generate a pair of public/private keys using an initial key provided to him/her. I don't know if this is called hierarchical key generation or multilevel key generation or something else. It's not important for the higher level key to be able to decrypt the data of the lower level I just need the pair to be be generated using another key. I have a seen some articles but they're all just theoretical. Is there a way to achieve this for RSA? 回答1:

Strange behavior of crypto_box_easy and crypto_box_open_easy. Decrypt without private key?

随声附和 提交于 2019-12-23 19:20:42
问题 I have tested Public-key-cryptography by libsodium and came across a strange behavior. The encrypted message is decrypted without the private key. Example from official site libsodium #include "sodium.h" #define MESSAGE "test" #define MESSAGE_LEN 4 #define CIPHERTEXT_LEN (crypto_box_MACBYTES + MESSAGE_LEN) static bool TestSodium() { unsigned char alice_publickey[crypto_box_PUBLICKEYBYTES]; unsigned char alice_secretkey[crypto_box_SECRETKEYBYTES]; crypto_box_keypair(alice_publickey, alice

How to load RSA Public Key generated by openSSL into RSACryptoServiceProvider?

◇◆丶佛笑我妖孽 提交于 2019-12-23 17:43:20
问题 I am writing a .Net Class that reads a cookie from our central authentication server. It contains the UserId, some timestamps and a signature created by openssl_sign() using a 2048 Bit RSA key and a SHA1 Hash. The current public key is provided in openssl PEM format on the server and changes on occasion. I cannot read the Key using .Net managed code alone (yet) and worked out the following procedure to get it working: Extract Exponent and Modulus from the public key Check key is still 2048

Public Key Encryption in Microsoft Edge

為{幸葍}努か 提交于 2019-12-23 10:59:22
问题 I have the following JavaScript code to implement public key encryption using the Web Cryptography API. It works for Firefox and Chrome but fails for Microsoft Edge. The error I am getting from Edge is "Could not complete the operation due to error 80700011." What have I missed? <script> var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); var crypto = window.crypto || window.msCrypto; var cryptoSubtle = crypto.subtle; cryptoSubtle.generateKey( { name: "RSA-OAEP", modulusLength: 2048,

Is KeyFactory thread-safe?

一世执手 提交于 2019-12-23 10:14:03
问题 There is a service class that needs to generate PublicKey instances from X.509-encoded public key representations. One instance of this class will service multiple threads. Is it correct to do something like this? public class MyService { private final KeyFactory rsaKeyFactory; public MyService() throws NoSuchAlgorithmException { rsaKeyFactory = KeyFactory.getInstance("RSA"); } public PublicKey generatePublicKey(byte[] publicKeyBytes) throws GeneralSecurityException { return rsaKeyFactory

Setting environment variable through SSH git push

泄露秘密 提交于 2019-12-23 01:36:22
问题 I'm reading Scott Chacon's Git book, and just wanted to confirm something. This part: You also have access to the user doing the pushing if the push is being run over SSH. If you’ve allowed everyone to connect with a single user (like “git”) via public-key authentication, you may have to give that user a shell wrapper that determines which user is connecting based on the public key, and set an environment variable accordingly. Here we’ll assume the connecting user is in the $USER environment

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

北慕城南 提交于 2019-12-22 18:04:25
问题 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

InvalidKeySpecException using public key

隐身守侯 提交于 2019-12-22 11:23:23
问题 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

RSA Encryption forceclosing before generating public/private keys

陌路散爱 提交于 2019-12-22 10:59:32
问题 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

How can I get the public key of a webpage?

一世执手 提交于 2019-12-22 04:41:05
问题 How can I get the public key of a website like VeriSign and all other websites which use https(secure protocol)? 回答1: It depends on the browser you're using, if you let me know I'll update my answer. Chrome 55 and above You can now find this information in Developer Tools. Options (3 dots) -> More Tools -> Developer tools, or press F12, then click the "Security" tab and you'll get a "Security Overview" with a "View certificate" button. As per another SO post from Chrome 60 you can actually