public-key

C# How to simply encrypt a text file with a PGP Public Key?

自作多情 提交于 2019-12-17 17:56:26
问题 I've researched a bit about how to achieve what I said in the question and found several APIs but most of them look very complicated and since I'm just a noobie in this area I just want a simple method like: public String Encrypt(String message, PublicKey publicKey) Don't know if this can be done? If not then please someone enlighten me another way to achieve this :) Thank you. UPDATE: So far I have only seen that all of the library for OpenPGP encryption require both the public key and

Android In App Billing: securing application public key

杀马特。学长 韩版系。学妹 提交于 2019-12-17 15:19:44
问题 From Android In App Billing version 3 (TrivialDrive)sample application coming with sdk MainActivity.java /* base64EncodedPublicKey should be YOUR APPLICATION'S PUBLIC KEY * (that you got from the Google Play developer console). This is not your * developer public key, it's the *app-specific* public key. * * Instead of just storing the entire literal string here embedded in the * program, construct the key at runtime from pieces or * use bit manipulation (for example, XOR with some other

How can I get SecKeyRef from DER/PEM file

谁都会走 提交于 2019-12-17 10:17:38
问题 I need to integrate my iPhone app with a system, and they require to encrypt data by a given public key, there are 3 files in 3 different format .xml .der and .pem, I have researched and found some articles about getting SecKeyRef from DER/PEM, but they are always return nil. Below is my code: NSString *pkFilePath = [[NSBundle mainBundle] pathForResource:@"PKFile" ofType:@"der"]; NSData *pkData = [NSData dataWithContentsOfFile:pkFilePath]; SecCertificateRef cert; cert =

JSch SFTP security with session.setConfig(“StrictHostKeyChecking”, “no”);

柔情痞子 提交于 2019-12-17 09:57:49
问题 I use JSch with private key to FTP file jsch.addIdentity(privatekeyfile); Session session = jsch.getSession( "user", "domain.com" ,22); session.setConfig("StrictHostKeyChecking", "no"); Line 3 is in question. Without this line, JSch does not work. My question is: Will line 3 make SFTP transfer insecure? 回答1: Disabling the StrictHostKeyChecking option will make the connection less secure than having the option enabled, because it will let you connect to remote servers without verifying their

.ssh config with amazon ec2 and git

僤鯓⒐⒋嵵緔 提交于 2019-12-17 06:50:30
问题 I have a strange problem with cloning a git repository from an amazon ec2 server. It works without any problems on one of my computers running ubuntu 12.04, while on another one using 12.10 it gives me an error: ssh: Could not resolve hostname ec2server: Name or service not known fatal: The remote end hung up unexpectedly It's like it is not recognizing my config file. I use the following git command to clone : sudo git clone ec2server:/var/www/project.git or sudo git clone ec2xxx.compute-1

What is the difference between a cer, pvk, and pfx file?

倖福魔咒の 提交于 2019-12-17 06:20:52
问题 What is the difference between a cer, pvk, and pfx file? Also, which files do I keep and which am I expected to give to my counter-parties? 回答1: Windows uses .cer extension for an X.509 certificate. These can be in "binary" (ASN.1 DER), or it can be encoded with Base-64 and have a header and footer applied (PEM); Windows will recognize either. To verify the integrity of a certificate, you have to check its signature using the issuer's public key... which is, in turn, another certificate.

Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly

十年热恋 提交于 2019-12-17 02:07:25
问题 I'm attempting to deploy my code to heroku with the following command line: git push heroku master but get the following error: Permission denied (publickey). fatal: The remote end hung up unexpectedly I have already uploaded my public SSH key, but it still comes up with this error. 回答1: You have to upload your public key to Heroku: heroku keys:add ~/.ssh/id_rsa.pub If you don't have a public key, Heroku will prompt you to add one automatically which works seamlessly. Just use: heroku keys

Simple use of RSACryptoServiceProvider KeyPassword fails

江枫思渺然 提交于 2019-12-14 02:06:47
问题 I want to protect my RSA private key with a password (who wouldn't) but the following C# fails: SecureString pw = new SecureString(); pw.AppendChar('x'); CspParameters prms = new CspParameters(); prms.KeyPassword = pw; RSACryptoServiceProvider crypto = new RSACryptoServiceProvider(prms); byte[] encrypted = crypto.Encrypt(Encoding.ASCII.GetBytes("encryptme"), true); ...with the CryptographicException: "Invalid type specified". If I take the KeyPassword assignment out it works fine. What am I,

How to load RSA public key from String for signature verification in Java?

别说谁变了你拦得住时间么 提交于 2019-12-13 14:03:40
问题 I have the following public key, that is stored in the DB (PostgresSQL) as text. It's a String, in java: -----BEGIN RSA PUBLIC KEY----- MIICCgKCAgEA1ht0OqZpP7d/05373OE7pB7yCVGNGzkUEuCneyfOzps6iA03NbvI 1ZL0Jpp/N3AW73lGdhaoa3X3JE4GsI/bsToVLQwTKmIOC4yjTvBctmFEoyhhTfxW s1UHZKl4XZ/7THbRlKHhRaTKyfDAbikkMAxNT/qutLAPjnN1qOwjb1oRq52NP6FJ KWTTikz4UeOHroX+Xthn2fJSJDlQ4YMdBbgrZVx5JcHKNuPTKRf5gI8QQKMSA9Q9 QJRE5OGp7b6dG14ZmOUnUxb00Mp20LgcaGPcuWU+oFsbQaF6W4G4bdkSZRJJXhSg d4Q7mahpar94

RSA. Java Encryption .NET Decryption

蓝咒 提交于 2019-12-12 08:17:21
问题 I need implement login to .NET Soap Web Service. This Web Service has method AuthenticateUser(username, password) and password should be encrypted with RSA public key. Below what I am trying to do: public static final String PUBLIC = "q/9CujExqL6rsMMO22WWIotoXDCw5KEmGQJqL9UJEfoErwZ9ZCm3OwMTSlAMSfoXEMA04Y1rhfYC3MtU/7dYEoREfsvOPGDBWanTKyMzv2otCfiURyQoghEdkhv3ipQQaaErT7lfBKobJsdqJlvxo4PCOUas2Z6YpoMYgthzTiM="; public static final String EXPONENT = "AQAB"; public static PublicKey getPublicKey()