key-pair

kSecAttrKeyTypeEC swift

北慕城南 提交于 2019-12-08 03:18:26
I try to get sha384 with ECDSA keys. I follow up with this article: https://digitalleaves.com/blog/2015/10/asymmetric-cryptography-in-swift/?replytocom=52690#respond but I change RSA to EC, of course. and keys are generated, but encryptMessageWithPublicKey doesn't work :( Variable "status" in method: encryptMessageWithPublicKey return -50 ... Here is my code: import UIKit import Security private let _singletonInstance = AsymmetricCryptoManager() private let kAsymmetricCryptoManagerApplicationTag = "com.AsymmetricCrypto.keypair" private let kAsymmetricCryptoManagerKeyType = kSecAttrKeyTypeEC/

ssh-keygen and openssl gives two different public keys

旧城冷巷雨未停 提交于 2019-12-07 15:20:29
问题 Is it possible that ssh-keygen & openssl can generate two different public keys from same private key? Command ssh-keygen -y -f ./my.key gives (contents after ssh-rsa in the same line) different public key to the one generated (contents between -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- ) with command openssl rsa -in my.key -pubout . 回答1: It's the same key but different representations. OpenSSL uses X.509 SubjectPublicKeyInfo in ASN.1, usually (including here) wrapped in PEM;

How to generate KeyPair in android KeyStore, protected by custom password

三世轮回 提交于 2019-12-07 03:52:17
问题 I have app which uses Fingerprint and 4 digit pin (which can be set by user in application settings, this is not system pin/pattern/password) authorization. With Fingerprint everything is fine, I have problem with pin. What I'm trying to do is: Let user set pin from application settings Generate Keypair in keystore for some alias protected by entered pin (so that private key can not be accessed without this pin) Send public key to server for future signature verification Get user token from

How to generate KeyPair in android KeyStore, protected by custom password

北城以北 提交于 2019-12-05 08:16:23
I have app which uses Fingerprint and 4 digit pin (which can be set by user in application settings, this is not system pin/pattern/password) authorization. With Fingerprint everything is fine, I have problem with pin. What I'm trying to do is: Let user set pin from application settings Generate Keypair in keystore for some alias protected by entered pin (so that private key can not be accessed without this pin) Send public key to server for future signature verification Get user token from server and store it in local storage Then during Authorization: Request user to enter the pin Retrieve

java.security.InvalidKeyException: Illegal key size or default parameters

主宰稳场 提交于 2019-12-04 20:13:36
I am creating a method to generate a key pair.I need to secure the private key with a password.My code works fine except that it gives me java.security.InvalidKeyException: Illegal key size or default parameters error. When i searched the cause of the error,it says to replace the policy jars in jre/lib/security folder with unlimited access files for the same.I have jdk7 installed and i downloaded the policy files and replaced that the lib/security folder.But the error remains the same.Here is the code. // generate a key pair KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); kpg

“Server Refused our key” after launching instance from private EBS AMI

£可爱£侵袭症+ 提交于 2019-11-30 08:23:49
I have created my own EBS AMI, shared it with another AWS account, launched NEW instance based on this image with NEW key-pair and now when I am trying to connect to this new instance I am getting error: "Server Refused our key". This is what I did (step by step): Configured new CentOS 6.3 server in my personal account (with my personal key-pair) Created EBS AMI image of that server Shared this image with my client's account Launched new instance in my clients account based on this shared image + new key-pair New launched instance doesnt want to take new key-pair. After some testing I figure

C# LINQ counting elements with DISTINCT

十年热恋 提交于 2019-11-28 04:14:09
问题 I have a collection of KeyValuePair items with DateTime as key and a string as value. Basically my data looks like: 12/07/2013 - 10220 12/07/2013 - 10220 12/07/2013 - 12220 12/07/2013 - 11240 12/07/2013 - 15220 13/07/2013 - 23220 13/07/2013 - 35620 14/07/2013 - 15620 14/07/2013 - 15620 I would like to have a List of how many items (distinct) I've for each days. So the query would result in a: 12/07/2013 - 4 13/07/2013 - 2 14/07/2013 - 1 回答1: use group by var dateGrouped = dates.GroupBy(x => x

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

天涯浪子 提交于 2019-11-27 09:32:24
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? 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 host keys. If the option is enabled, you will only be able to connect to servers which keys are known to

Change key pair for ec2 instance

冷暖自知 提交于 2019-11-26 04:02:59
问题 How do I change the key pair for my ec2 instance in AWS management console? I can stop the instance, I can create new key pair, but I don\'t see any link to modify the instance\'s key pair. 回答1: This answer is useful in the case you no longer have SSH access to the existing server (i.e. you lost your private key). If you still have SSH access, please use one of the answers below. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-lost-key-pair Here is what I did,