RSA Encryption - Private Key Encryption

I am looking for a way to encrypt data using a private key, and the public key decrypts it. I know that this is NOT what you want from encryption at all, as it will be readable by anyone who has a public key, but this is exactly what I need.

I need the data string to be encrypted using the private key, so that only I can create encrypted data, and my application will read them using the public key. The idea is to create a license file for my application, encrypt the license details and force the application to read this data. This will prevent the generation of licenses by anyone other than me, but allow the application to read it using the public key.

The idea behind this is to control the encrypted data, and it doesn’t matter who can read it, only who can create it.

Using RSACryptoServiceProvider, I can create my public / private keys, I can encrypt data using the private key, however, when I go to decrypt with the public key, I get an exception "Key not found".

Signing with RSA is also not possible, because I need to compare the encrypted data with the plain text data to make sure that the license is valid, and only the source confirms the signing, and not what it contains.

Is there any other cryptography provider that I could use to achieve this, or some other method of reading license information in which I save the private key and distribute the public key with my license verification application.

Hooray

+3
source share
3 answers

You need to sign. In fact.

The entire subscription API is aimed at signing a Hash value because RSA is slow, so the hash is used as a synopsis. This should meet your needs, you can always send unencrypted text nearby. You use the signature to verify it.

+6
source

The answer from the OP in the question:

- It was agreed -

, , , , , : http://juzzbott.com/2010/11/signing-and-verifying-data-within-csharp-encrypting-with- /

bjarkef & Henk Holterman , , .

0

, . , , , , , , .

" " . , , , , .

(PSSR).


, , . -, , .

, , " ", . [-] , .


RSA , , , , , , .

. ...


- , , - , .

, Microsoft .Net Recovery.

, Botan Crypto++ . Wrapper DLL Interop .

Crypto++ - RSA Crypto++ . PSSR - .

RSASS<PSSR, SHA256>::Signer signer(privateKey);
RSASS<PSSR, SHA256>::Verifier verifier(publicKey);
0

Source: https://habr.com/ru/post/1772746/


All Articles