Questions tagged [shared-secret]

Shared key is a piece of data, known only to the parties involved, in a secure communication. The shared secret can be a password, a passphrase, a big number or an array of randomly chosen bytes.

In cryptography, a shared secret or shared key is a piece of data, known only to the parties involved, in a secure communication. The shared secret can be a password, a passphrase, a big number or an array of randomly chosen bytes.

The shared secret is either shared beforehand between the communicating parties, in which case it can also be called a pre-shared key, or it is created at the start of the communication session by using a key-agreement protocol, for instance using public-key cryptography such as Diffie-Hellman or using symmetric-key cryptography such as Kerberos.

The shared secret or shared key can be used for authentication (for instance when logging into a remote system) using methods such as challenge-response or it can be fed to a key derivation function to produce one or more keys to use for encryption and/or MACing of messages.

To make unique session and message keys the shared secret is usually combined with an initialization vector (IV). An example of this is the derived unique key per transaction method.

It is also often used as an authentication measure in APIs.

Source : wikipedia article

48 questions
2
votes
0 answers

Unknown error generating App-Specific Shared Secret

I am working on setting up remote receipt validation for IAP and I need to generate an App-Specific Shared Secret. My account has admin privileges, however, when I click to generate the secret I get the error There was a problem retrieving the data…
Bernard
  • 1,004
  • 1
  • 12
  • 21
2
votes
1 answer

NSec.Cryptography encrypt and decrypt using ChaCha20Poly1305 and SharedSecret

I'm trying to encrypt (and decrypt) messages send from one device to another by using NSec.Cryptography, but I find the documentation a bit vague. As I understood I need a Key and PublicKey of device A and B, respectively. I can turn these into a…
Yuri van Geffen
  • 853
  • 1
  • 7
  • 21
2
votes
1 answer

Shamir Secret Sharing: I cant get the right reconstructed value in javascript

I try to use shamir secret sharing. I implement the code that I find in wikipedia. But when I run it, for enormous numbers the result of reconstruction is different from the real secret…
uoyh
  • 23
  • 4
2
votes
0 answers

How to use Crypto++'s Secret Sharing class to share memory blob

I am building the protocol to share a random generated n long password between k parties using crypto++ shamir's secret sharing class. The problem is that all examples that I found on the internet about the cryptopp's sss are based on the file…
2
votes
3 answers

What is a C++ library with an ECDiffieHellmanCng-compatible implementation?

I'm looking for a key exchange solution between a .NET app and an embedded device. The two endpoints have a shared secret key, making the Elliptic Curve Diffie-Hellman (ECDH) algorithm excellent for securely exchanging a master secret for the…
Edward Brey
  • 40,302
  • 20
  • 199
  • 253
1
vote
1 answer

Why does my ECDH shared secret generation sometimes fail?

I'm working on Apple Pay's in-app Wallet Provisioning. I've made a test project that matches the test vectors I get from Apple's documentation (utilizing System.Security and BouncyCastle), so pretty sure I'm on the right track. However, when I…
Paul S
  • 13
  • 4
1
vote
1 answer

Creating shared secret using public and private keys using swift

I am trying to convert an ephemeralKey which is a series of bytes to an Elliptic Curve public key and then use it to create a shared key using my private key. I know how to do this in python (code below). But I cannot find a way to do this in Swift.…
RawMean
  • 8,374
  • 6
  • 55
  • 82
1
vote
1 answer

Derive Shared Secret From ECDH with existing foreign public key - Swift

I'm converting a method that I have working in both NodeJS/Java to Swift but I'm having trouble getting it to work. Hoping someone can help me covert this to Swift NodeJS Code: //the public_key param here is from a different device. sign:…
alexward1230
  • 579
  • 3
  • 8
  • 25
1
vote
0 answers

Compute Diffie-Hellman key pair and shared secret in iOS with Swift

I need on iOS with Swift to: Generate a Diffie–Hellman key pair with a pre-agreed modulus P and a base G Compute a shared secret with a local private key, a remote public key and pre-agreed modulus P And this without Elliptic-curve Diffie–Hellman…
romainb78
  • 51
  • 1
  • 8
1
vote
0 answers

Python implementation of ed25519 shared secret agreement

Let's consider the following example. Using Python library tinyec I can write the following code: def compress(pubKey): return hex(pubKey.x) + hex(pubKey.y % 2)[2:] curve = registry.get_curve('brainpoolP256r1') alicePrivKey =…
docdev
  • 943
  • 1
  • 7
  • 17
1
vote
1 answer

C# .NET Framework 4.7.2 in VS 2019 - keep out my clientID and client secret / gitignore / Key Vault

I am a new to #C, therefore excuse my question, which will be probably very easy to you. I am trying to get my clientID, clientSecret and tenantID out of the main source control, but I am not sure at all how to do that. I have seen some methods for…
1
vote
1 answer

EC Client and Server shared secret mismatch ( could be due to client pub key not in correct format while generating server shs)

I am trying to generate shared secret using EC named curve and finding mismatch in client vs server shared secret. Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); // Client KeyPairGenerator kpg =…
1
vote
1 answer

Two way shared secret

I am working on a project where two parties can each make API requests to each other and are authenticating using a shared secret. The other party wants the shared secret to be the same both ways, but I don't understand how that would work. So I'm…
Aaron Z
  • 11
  • 1
1
vote
1 answer

What type of array required in WritableRaster method setPixels()?

I don't understand how WritableRaster class of Java works. I tried looking at the documentation but don't understand how it takes values from an array of pixels. Plus, I am not sure what the array of pixels consists. Here I explain. What I want to…
Samarth Shah
  • 878
  • 8
  • 14
1
vote
1 answer

What is the benefit of the shared secret in OAuth 1.0A?

What is the benefit of the OAuth 1.0A shared secret? From what I understand, a client can register with a protected resource server in which the client receives both a client identier and a shared secret in return. Even though I've read the OAuth…
user1431072
  • 1,272
  • 2
  • 13
  • 32