Questions tagged [public-key-exchange]

43 questions
4
votes
3 answers

Output SecKeyCopyExternalRepresentation

I'm trying to pass around a public key from my iPhone to other parties, however I am unable to use the output from iOS. let parameters: [String: Any] = [ kSecAttrKeySizeInBits as String: 384, kSecAttrKeyType as String: kSecAttrKeyTypeEC, …
Bram
  • 2,718
  • 1
  • 22
  • 43
3
votes
1 answer

Read whole message with bufio.NewReader(conn)

I am working on a simple chat server and client in golang. I am having some trouble with reading messages from the net.Conn. So far this is what I have been doing: bufio.NewReader(conn).ReadString('\n') Since the user presses enter to send the…
Pådne
  • 91
  • 3
  • 9
3
votes
0 answers

Scala SSH: Connecting to hosts with public key exchange

I am a noob to scala and trying to figure out how to use Scala SSH to connect to a server with SSH client keys / public key exchange configured. My goal is to create a successful SSH connection to a server with proper config of client keys without…
harschware
  • 13,006
  • 17
  • 55
  • 87
2
votes
2 answers

OpenSSL public key from EVP_PKEY to buffer

I'm programming a client that partecipates in a TLS 1.2 handshake by sending messages through a TCP socket connected to Google's server. I'm using the ECDH key exchange method. I generated the client keypair using this code, and now I want to send…
Myrrdyn
  • 25
  • 6
2
votes
1 answer

java.security.InvalidKeyException thrown during Java AES key exchange using RSA

I'm trying to make a client/server program in Java that allows the server to send messages encrypted using AES to the client. Right now, I'm having problems while creating the key exchange protocol. The way that this key exchange current works…
2
votes
1 answer

C# - importing a public key blob into ECDiffieHellmanCng

I'm having trouble exchanging keys using the ECDiffieHellmanCng class: Step 1 - Create a public key public byte[] CreatePublicKey() { using (ECDiffieHellmanCng cng = new ECDiffieHellmanCng()) { cng.KeyDerivationFunction =…
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313
2
votes
1 answer

How to verify a signature in .net generated in Android

The problem is the following: I generate the key in Android (Xamarin.Droid): public IPublicKey CreateKey(string keyID) { /*KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance( KeyProperties.KEY_ALGORITHM_RSA,…
Ricardo Almeida
  • 163
  • 3
  • 14
2
votes
1 answer

Unable to open SFTP Connection via phpseclib

I am trying to open a sftp connection via latest phpseclib version. I can successfully connect via Filezilla, where i was prompted to accept the servers fingerprint on first connection attempt too. Here is the log prouced by: …
2
votes
2 answers

OpenSSL RSA extract public key with .cer format

I'm using openSSL to create RSA public and private key. I create success, and output is 2 keys with format private_key.pem and public_key.pem. So, the requirement is public key need to be in .cer extension, Base 64 format and start with header:…
Tran Tam
  • 699
  • 3
  • 14
  • 27
1
vote
1 answer

PKCE with RSA both ways

Can PKCE be implemented with both server and client generating public and private keys? Is it worth it? What I think is this flow: Client generates private and public key Client sends public key to server Server generates private and public key,…
1
vote
1 answer

Diffie Hellman Key Agreement using optional subprime q with DHParameterSpec in Java

I am trying to perform a Diffie Hellman Hey agreement, and as part of the parameter definition, I have 3 values: a prime modulus p a base generator g a subprime q looking at the various constructors for creating the keys necessary to perform this…
1
vote
1 answer

I want to change the values of P and G for diffiehellman in openssl

Since parameter generation can be an expensive process this is normally done once in advance and then the same set of parameters are used over many key exchanges. Is there any way to modify p and g before its advance set up?
1
vote
1 answer

How to convert hex public key to ASN.1 SubjectPublicKeyInfo structure for Diffie-Hellman key exchange?

I am trying to implement Diffie-Hellman key exchange to generate the symmetric key for encryption/decryption using JAVA cryptography packages. This requires a public key exchange between the two parties. The public key shared by the client is 1024…
1
vote
0 answers

Diffie-Hellman in swift can work with JAVA

I am trying to develop key-exchange Diffie-Hellman between a Swift and a Java server . I read all link about Diffie-Hellman and in all of them told I should use (g^a mod p)^b mod p = g^ab mod p for making PublicKey. But when I started to share my…
Yoshimitsu
  • 4,343
  • 2
  • 22
  • 28
1
vote
1 answer

How to verify whether I am really chatting with my friend using GPG and his public key?

I am chatting with my friend via Skype chat and I want to know whether it is really my friend Bob on the other side. I have Bob's public key and I am 100% sure that this is real Bob's public key. How can I verify that this is really Bob who is…
BB-8
  • 565
  • 2
  • 9
  • 18
1
2 3