Cody

# Problem 44956. Determine RSA keys (public and private) given two prime number character strings (p and q)

Solution 1914749

Submitted on 28 Aug 2019 by David Hill
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
p = '3355335697481001330501721'; q = '5955344080483688912855719'; n='19982178584029090861856118769095354822153154192399'; d='3270348772331599380262578849367006078599068947553'; assert(isequal(keyGeneration(p,q),[n,d]))

2   Pass
p = '93037756831'; q = '17785098263'; n='1654685647408434484553'; d='725024841658883005807'; assert(isequal(keyGeneration(p,q),[n,d]))

3   Pass
p = '78445275631437761053992885895750465398835896260471'; q = '847499834278955184287826614272883468653478706441911'; n='66482358097610463994867710743893941780373028603550532696855128388110687736445597102935797782887000081'; d='17811270633044608798417493404356162622332264769841829735067863001954821606264062026927272333676178327'; assert(isequal(keyGeneration(p,q),[n,d]))

4   Pass
p = '2449667355156487343774697713540280806525165001048658091515078995215570651954964855632584143484331239'; q = '22414727030201121159924352041094970676527238843699538490571313450522219987131036654257757615301164967'; n = '54908625080627406684257511450461945343426401541483063224667540000046626655110499362398335807573893715932039094796322424656024356193267898880278706314683180360742345748776241330320283731816867610504113'; d = '21021900787311324307104463429872296116879195585354098286008411220244593274079947808137947171030663085014240404725983352773722473224166347094575707639420712533404234877636140590997487746714862681054571'; assert(isequal(keyGeneration(p,q),[n,d]))

5   Pass
p = '26892754546730837119898059580995437039544399594421875855251066246511044160199048288603963625982639028058714345196159764252398791569637860905138287322706679328840515337572608690956308136959236074835599'; q = '76019400184540822543696224086250845563040709795227937154720461468348727220343229834542918037619525984430713380822472295398107810565069813256377730791194881206750953165713183208458761595898204049235781'; n='2044371069952561243871813747701535503388267616657953475148898181142012590397809234167373308955772082860082985954286137615597515257087506574051530104475374974920093127841789408014496870693507622812332673504654584870100580476794800708440785082437228308551107726064054828640053321250498545183042994878498928173976370185712833904492317580152665428272199317847097773542066059565512439224992672101163367819'; d='131358569595346680469722564224349085322306406056832660693226883146757023027681686453130430199929142940992255578581548217026735077095312421736286269892515739496597527524021166625708322359741224036234988705082882699895245449017415856831226734459122764117157172961113990706104659539690141481103935528273973382371183154438463086325519326121228923730136467766036183357672350586091588640276470994058874793'; assert(isequal(keyGeneration(p,q),[n,d]))