Git Product home page Git Product logo

Comments (4)

Sejal-G avatar Sejal-G commented on May 12, 2024 1

same mistake in:
key exchange and DHKE:

  • In a key transport scheme only one of the parties contributes to the shared secret and the other party obtains the secret from it. Key transport schemes are typically implemented through public-key cryptography, e.g. in the RSA key exchange the client encrypts a random session key by its private key and sends it to the server, where it is decrypted using the client's public key

regardless of algorithm, encrypting by a private key is useless as anybody has access to the public key, so anyone can easily decrypt and reads the original message (or session key)

with reference to the last line!!
@azadkuh messge encrypted with a public key can be decrypted with private key, and not vice versa!
Correct me if I am wrong, I am a newbie at cryptosystems.

from practical-cryptography-for-developers-book.

azadkuh avatar azadkuh commented on May 12, 2024

same mistake in:
key exchange and DHKE:

  • In a key transport scheme only one of the parties contributes to the shared secret and the other party obtains the secret from it. Key transport schemes are typically implemented through public-key cryptography, e.g. in the RSA key exchange the client encrypts a random session key by its private key and sends it to the server, where it is decrypted using the client's public key

regardless of algorithm, encrypting by a private key is useless as anybody has access to the public key, so anyone can easily decrypt and reads the original message (or session key)

from practical-cryptography-for-developers-book.

ceduliocezar avatar ceduliocezar commented on May 12, 2024

@guydingmike just realized the problem that u reported.

Since you reportd it a long time ago and the problem is still there I created a PR for it.

#29

from practical-cryptography-for-developers-book.

azadkuh avatar azadkuh commented on May 12, 2024

@Sejal-G you're absolutely right.

some libs even issue an error if a private key is used for encryption, although it may be possible to extract the public key from the private key efficiently (as in RSA)

more ever, it may be mathematically impossible to decrypt a ciphered text by a public key as it does not contain all required bits for decryption.

regardless of mathematical possibility, using a private key for encryption is semantically wrong and compromises the security as everyone can obtain the public key.

ps. I'm not a guru either.

from practical-cryptography-for-developers-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.