How the RSA algorithm works, including how to select d, e, n, p, q, and φ (phi)

How the RSA algorithm works, including how to select d, e, n, p, q, and φ (phi)

Anthony Vance

9 лет назад

323,680 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Deepthi B
Deepthi B - 13.05.2023 21:46

Could not get the answer for p=23, q=19, and e=283 with the steps. Can someone try n lmk?

Ответить
give 1 k subs for polls pls
give 1 k subs for polls pls - 24.03.2023 01:02

π

Ответить
Madhab ahl al-Madinah
Madhab ahl al-Madinah - 12.01.2023 15:59

A simple trick to get the d as well: d = e-1 mod φ(n). Let's take the example in the video:

e = 7
φ(n) = 40

7^-1 mod 40 = 23

and that's how you can get it without going through the steps of the Extended Euclidean Algorithm

Ответить
Hello World
Hello World - 02.01.2023 12:06

How to choose e, just a small prime that doesn't share a factor with φ(n) ?

Ответить
rrr00bb
rrr00bb - 06.11.2022 20:59

I would make a big distinction in RSA between asymmetric encryption and public-key encryption. If you use a well-known and small 'e', you have public key, but can't support 'asymmetric' key encryption. With 'asymmetric' key encryption, 'e' and 'd' have the same properties; and are equally secret.

I use it to make digitally signed tokens such that you don't know the plaintext until you produce a witness that you performed verify to extract a secret to decrypt the signed claims. That way, the signer distribute the verify key to those who are allowed to VERIFY. It's not totally public, because it's (n,e), but signer has (n,d,e). This allows tokens to be passed around so that man-in-the middle can't decode the claims, and the verifier can only extract verified claims. ie: the current way of checking signatures (plaintext,Sign(H(plaintexty))=sig) has security problems. The main one being that you allow people to not verify the signatures; something that is very common in the hands of web developers. And the other is in leaking the tokens to intermediate proxies.

Ответить
Free Wheel Burnin'
Free Wheel Burnin' - 03.09.2022 11:17

thats fun stuff

Ответить
Brigitte Nsengiyumva
Brigitte Nsengiyumva - 05.07.2022 14:58

I have used your way finding D but I ended up with zero instead of 1. my number was p=5 and q=13 and e=35 I was not able to get a correct answer, I don't know why?

Ответить
MissNorington
MissNorington - 17.12.2021 17:06

Thank you for making this easy to understand! I am no good with math but I like to be able to use it from time to time! 😀

Ответить
Vishal Mishra
Vishal Mishra - 18.11.2021 05:16

For MOD-Inverse - Use pow() the built-in function in Python3.8 - e.g. d = pow(e, -1, (p-1)*(q-1) )

Ответить
TJ Bah
TJ Bah - 06.10.2021 02:11

Thanks for this.

Ответить
Michael McGoldrick
Michael McGoldrick - 01.10.2021 08:40

Thank you this was very helpful

Ответить
Bennet Braune
Bennet Braune - 08.06.2021 12:06

Thank you, I got stuck implementing the RSA in Python at "d". your calculation path was easy to implement.

Ответить
AJITH KUMAR
AJITH KUMAR - 02.06.2021 18:31

Best explanation ever.. Thank you.
Can I get the video for Elliptic Curve Cryptography, from you, please?

Ответить
Rob Godfrey
Rob Godfrey - 09.04.2021 07:40

Stellar video

Ответить
Oysa
Oysa - 30.03.2021 15:02

Thank the lords for this video!

Ответить
Francisco Arredondo
Francisco Arredondo - 28.03.2021 20:56

This has to be one of the best if not the very best explanation of the RSA algorithm that i've come across, Thank you!

Ответить
Mekdim Tam
Mekdim Tam - 09.03.2021 00:04

tnkz bud

Ответить
Chris Weaver
Chris Weaver - 08.03.2021 16:13

OMG! so I am being taught Maths in uni and its basically everything in this getting me ready for next year. I find it hard to follow the lecturer sometimes and this is amazing! I need to also program a crypto algorithm and this gives me a good base! THANK YOU!

Ответить
Jason Lucero
Jason Lucero - 31.01.2021 11:41

Amazing

Ответить
BrightFuture
BrightFuture - 27.01.2021 04:13

Thank you

Ответить
Nina Jentsch
Nina Jentsch - 08.01.2021 15:19

how is 40 ÷ 7 = 5? my calculator and my brain says it's 5,714....

Ответить
Nina Jentsch
Nina Jentsch - 05.01.2021 12:57

what if i have something like phi- 24 and e- 11??

Ответить
Sharon Omonua
Sharon Omonua - 31.12.2020 02:16

what is mod!??!

Ответить
KF
KF - 24.11.2020 10:25

This is hands down the best RSA video out there. Too bad it took me so long to find it >.<

Ответить
Abdou Rahmane Bah
Abdou Rahmane Bah - 19.11.2020 18:43

Allez Adams

Ответить
Abdou Rahmane Bah
Abdou Rahmane Bah - 19.11.2020 18:40

Je t'aime

Ответить
It's Only Me
It's Only Me - 01.11.2020 22:03

Thanks for this terrific explanation.

Ответить
Syed Akmal Ali
Syed Akmal Ali - 13.10.2020 10:50

so great, very well explained, thank you so much.

Ответить
DB
DB - 19.09.2020 06:42

You're the best!

Ответить
po bg
po bg - 15.09.2020 20:03

this video is PERFECTION

Ответить
Magic Square Puzzles
Magic Square Puzzles - 02.09.2020 05:00

Very well explained

Ответить
RuYaLa
RuYaLa - 24.07.2020 19:44

i love u man

Ответить
bharath nayak
bharath nayak - 19.07.2020 11:53

Best explanation 👍

Ответить
Marcio Castro
Marcio Castro - 08.07.2020 20:38

Good explanation, but is important to point that e must be coprime with phi and N. With small numbers, it's relatively easy to pick a value for e, but if p and q have 30 digits each...

Ответить
leathernluv
leathernluv - 03.07.2020 13:58

Now if someone would just do a video of how to use this on a message of arbitrary length in C or Python that was easy to follow for someone learning to code.

Ответить
Rafi mohammad
Rafi mohammad - 30.06.2020 09:45

Simply Superb Job.... Want to give 1K likes

Ответить
Chaya 2766
Chaya 2766 - 12.06.2020 02:05

u made my day & saved my time & I love you
not rly but great video & u explained everything so well & simply that even I could follow & now I wrote a working python script & I'm happy ^^

Ответить
Kajdron M.
Kajdron M. - 09.06.2020 14:18

Interresting content but boring presentation.

Ответить
Steerpike
Steerpike - 18.05.2020 20:50

I've knocked together a primitive Python implementation of this and I've got two problems so far. One is that the algorithm to derive d occasionally results in a divide-by-zero error, which I've solved simply by scrapping it and starting over with a new value of e. It's still quick but there must be a more elegant solution to avoid the error in the first place?

The second problem is that, for anything more than three-digit values for p and q, the actual encryption and decryption is incredibly slow. For four-digit values it clocks in at almost a minute and a half. Why is it so slow when this process happens routinely for much larger primes than anything I'm using?

Ответить
Ar Joni
Ar Joni - 28.04.2020 02:44

|x|

Ответить
Zuschauerquaeler
Zuschauerquaeler - 24.04.2020 23:13

Can somebody please explain to me how the message doesn't lose information when you calculate modulo n? As modulo is not an injective function?

Ответить
Karim Barakat
Karim Barakat - 30.03.2020 20:39

thank you, your explanation was just great.

Ответить
Nada
Nada - 26.03.2020 04:31

you are amazing!!! good work, you got a new sub

Ответить