NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Q1.1
voir cahier + https://rietta.com/blog/2012/01/27/openssl-generating-rsa-key-from-command/

Commands>
openssl genrsa -des3 -out tomKey.pem 2048
openssl rsa -in tomKey.pem -text
openssl rsa -in tomKey.pem -outform PEM -pubout -out tomPublic.pubkey

Q1.2
We must use the public key to make sure the text is properly encrypted
We can also do it with a passphrase so it is more secure
Commands>
nano plain.txt
this is a confidential message
openssl
pkeyutl -encrypt -inkey tomKey.pem -in plain.txt -out encRSA.txt

openssl pkeyutl -encrypt -in plain -inkey rsa.key -out encRSA : This command encrypt the file plain with the key rsa.key to the file encRSA

To decrypt : openssl pkeyutl -decrypt -inkey tomKey.pem -in encRSA.txt -out decRSA.txt

test to encrypt the 2 support files

openssl pkeyutl -encrypt -inkey tomKey.pem -in 03support_rsaplain1 -out encRSAPlain
Enter pass phrase for tomKey.pem:
root@kali:~# openssl pkeyutl -encrypt -inkey tomKey.pem -in 03support_rsaplain2 -out encRSAPlain2
Enter pass phrase for tomKey.pem:
Public Key operation error
140669292762768:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:rsa_pk1.c:153:

Here obviously the data is too large for the key size, which mean that we should use a larger key in order to encrypt that data

Q1.3

When encrypting, you use their public key to write message and they use their private key to read it.

When signing, you use your private key to write message's signature, and they use your public key to check if it's really yours.

A signature is proof that the signer has the private key that matches some public key. To do this, it would be enough to encrypt the message with that sender's private key, and include the encrypted version alongside the plaintext version. To verify the sender, decrypt the encrypted version, and check that it is the same as the plaintext.

However, this means doubling the size of your transmission - plaintext and ciphertext together (assuming you want people who aren't interested in verifying the signature, to read the message). So instead, typically a signature is created by creating a hash of the plaintext.

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.