public-key

If public key of two files are same, is it sufficient to conclude that they were signed by the same certificate?

烈酒焚心 提交于 2019-12-10 22:44:10
问题 I am implementing an auto-update mechanism for my software. The msi on the server is signed using signtool. My app downloads the msi and reads the public key of the downloaded msi. If the public key matches the one that is hard coded in the source code, it will execute the msi and update itself. Would this is be sufficient to ensure that no malicious msi gets executed by mistake? My understanding is that a file will have the same public key ONLY if signed by my certificate. Edit: With petey's

RSA Encryption public key not returned from container?

久未见 提交于 2019-12-10 22:05:10
问题 I feel like what I am trying to do is very simple. But for some reason it doesn't want to work: Here is a complete code snippet to test what I am trying to do: using System; using System.Xml; using System.Security.Cryptography; using System.Security.Cryptography.Xml; namespace XmlCryptographySendingTest { class Program { static void Main(string[] args) { string fullKeyContainer = "fullKeyContainer"; string publicKeyContainer = "publicKeyContainer"; //create the two providers

In Public Key Cryptography how the server decrypts the message from client? [duplicate]

只谈情不闲聊 提交于 2019-12-10 12:27:54
问题 This question already has answers here : Whose key is used to encrypt a HTTPS response? (3 answers) Closed last year . In the Public Key Cryptography all I know is that the public key in the server is to encrypt the message and the client which has the private key can decrypt that message which is fine. The part which I don't understand is that as the server has only the public key to encrypt the message how it would decrypt the response from the client. I believe that the public can't be

WinSCP commandline: Hostkey not found in cache error

筅森魡賤 提交于 2019-12-10 10:23:49
问题 I am trying to connect to Unix server from WinSCP commandline for the first time. It closes with the the following error: The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: ssh-rsa 1024 42:9e:c7:f4:7f:8b:50:10:6a:06:04:b1:d4:f2:04:6d If you trust this host, press Yes . To connect without adding host key to the cac he, press No. To abandon the connection press Cancel . In the WinSCP

public key for encryption; private key for de-cryption?

守給你的承諾、 提交于 2019-12-10 09:47:01
问题 I understand that private and public keys are mathematically related and data encrypted with one key can only be decrpyted with other. My question is that private key is always used to encrypt data whereas public key is always used to de-crypt it? Or can be be vice-vera and if so can you give some example application where its used in other direction (public key to encrypt and private key to decrypt)? 回答1: It's interchangeable. Digital Signature -> Private key encrypts, public key decrypts so

openssl_pkey_get_public not open public key, “no start line” error

时光总嘲笑我的痴心妄想 提交于 2019-12-09 05:39:22
问题 When generating public key and then reading it with function openssl_pkey_get_public - $publicKeyResource = bool(false) and message: error:0906D06C:PEM routines:PEM_read_bio:no start line $privateKey = openssl_pkey_new(array('private_key_bits' => 2048, 'private_key_type' => OPENSSL_KEYTYPE_RSA)); $keyDetails = openssl_pkey_get_details($privateKey); $publicKeyResource = openssl_pkey_get_public($keyDetails['key']); What is wrong? P.S. privateKey = array(3) { ["bits"]=>int(2048) ["key"]=> string

SSH into staging machine from docker instance using Bitbucket Pipelines

偶尔善良 提交于 2019-12-09 04:46:29
问题 Using the new Bitbucket Pipelines feature, how can I SSH into my staging box from the docker container it spins up? The last step in my pipeline is an .sh file that deploys the necessary code on staging, however because my staging box uses public key authentication and doesn't know about the docker container, the SSH connection is being denied. Anyway of getting around this without using password authentication over SSH (which is causing me issues as well by constantly choosing to

How to communicate AES initialization Vector to client for hybrid cryptosystem

白昼怎懂夜的黑 提交于 2019-12-08 23:27:12
问题 I need to implemented security for client-server communication. I have implemented the following hybrid cryptosystem To encrypt a message addressed to Alice in a hybrid cryptosystem, Bob does the following: Obtains Alice's public key. Generates a fresh symmetric key for the data encapsulation scheme. Encrypts the message under the data encapsulation scheme, using the symmetric key just generated. Encrypt the symmetric key under the key encapsulation scheme, using Alice's public key. Send both

How to read public key from PFX file in java

不问归期 提交于 2019-12-08 12:45:52
问题 I am able to read private key from PFX file but not public key. I am using following code to read public key. InputStream inStream = new FileInputStream(certFile); CertificateFactory cf = CertificateFactory.getInstance("X.509"); BufferedInputStream bis = new BufferedInputStream(inStream); // if (bis.available() > 0) { java.security.cert.Certificate cert = cf.generateCertificate(bis); System.out.println("This part is not getting printed in case of PFX file"); // } puk = (PublicKey) cert

JSch scp without known_host file and with StrictHostKeyChecking

家住魔仙堡 提交于 2019-12-08 12:37:01
问题 I am trying to copy some files from a Windows machine to a Linux machine, which is working fine with JSch so far. I can copy files using StrictHostKeyChecking no or I need to have the known_host file from the Linux machine I copy to. I am using the code for a Java project which should be able to send files automatically to (unknown) Linux machines. I got the username, password, IP and the publickey for the machine. Is there any way to authenticate without the known_host file and via the