Content uploaded by Peace Falola
Author content
All content in this area was uploaded by Peace Falola on Sep 21, 2022
Content may be subject to copyright.
Available via license: CC BY 4.0
Content may be subject to copyright.
Information2022,13,442.https://doi.org/10.3390/info13100442www.mdpi.com/journal/information
Article
SecureSensitiveDataSharingUsingRSAandElGamal
CryptographicAlgorithmswithHashFunctions
EmmanuelA.Adeniyi
1
,PeaceBusolaFalola
1,
MashaelS.Maashi
2
,MohammedAljebreen
3
andSalilBharany
4,
*
1
DepartmentofComputerSciences,PreciousCornerstoneUniversity,Ibadan200223,Nigeria
2
SoftwareEngineeringDepartment,CollegeofComputerandInformationSciences,KingSaudUniversity,
Riyadh11451,SaudiArabia
3
DepartmentofComputerScience,CommunityCollege,KingSaudUniversity,P.O.Box28095,
Riyadh11437,SaudiArabia
4
DepartmentofComputerEngineering&Technology,GuruNanakDevUniversity,Punjab143005,India
*Correspondence:salil.bharany@gmail.com
Abstract:Withtheexplosionofconnecteddeviceslinkedtooneanother,theamountoftransmitted
datagrowsdaybyday,posingnewproblemsintermsofinformationsecurity,suchasunauthorized
accesstousers’credentialsandsensitiveinformation.Therefore,thisstudyemployedRSAandEl‐
GamalcryptographicalgorithmswiththeapplicationofSHA‐256fordigitalsignatureformulation
toenhancesecurityandvalidatethesharingofsensitiveinformation.Securityisincreasinglybe‐
comingacomplextasktoachieve.Thegoalofthisstudyistobeabletoauthenticateshareddata
withtheapplicationoftheSHA‐256functiontothecryptographicalgorithms.Themethodology
employedinvolvedtheuseofC#programminglanguagefortheimplementationoftheRSAand
ElGamalcryptographicalgorithmsusingtheSHA‐256hashfunctionfordigitalsignature.Theex‐
perimentalresultshowsthattheRSAalgorithmperformsbetterthantheElGamalduringtheen‐
cryptionandsignatureverificationprocesses,whileElGamalperformsbetterthanRSAduringthe
decryptionandsignaturegenerationprocess.
Keywords:datasharing;cryptographicalgorithm;RSAandElGamal;communication;digital
signature
1.Introduction
Withtherapiddevelopmentofinformationdigitization,securityandprivacycon‐
cernsareamongthemostpressingproblemsconfrontingtheemergingsmartgrid[1].
Theseissuesinclude,amongmanyothers,alackofsharedauthenticationacrosscom‐
municatingparties,thepossibilityofmultiplecyber‐attacks,illegitimateaccesstoser‐
vices,andthedisclosureofcomputerandnetworkconfidentialinformationtotheinter‐
actingparty.Beforegrantinganyindividualaccesstoanetworkanditsassociatedser‐
vices,itisnecessarytovalidatetheindividual,whichmaybeacomputeroraperson,and
thenvalidatethepermissionandcontrolpoliciesbasedontheindividual’sidentification.
Adigitalsignaturevalidatestheuser’sidentity,whereasauthorizationvalidateswhether
thepersonhasthenecessaryauthoritytoaccessthesharedresource[2].
Encryptionisalwaysrequiredfordatatransmissionandcommunication[3].Infor‐
mationsecurityutilizingencryptionanddecryptioniscrucialsincedatatransmissionand
receptionaresusceptibletooutsideassault.Toincreasesecurity,dataaretransformed
intoacodedmessage(encryption)andthenrecoveredintodata(decryption)[4].Tooffer
securetransmissionofdataandinformation,severalcryptographicalgorithmshavebeen
proposed,whichcanbeclassifiedassymmetricandasymmetriccryptographictechniques
[5].Figure1displaystheprocesstheplaintextpassedthroughbeforeturningintocipher‐
textandthenbackintoplaintext.Theplaintextpassesthroughtheencryptionprocessto
Citation:Adeniyi,E.;Falola,P.B.;
Maashi,M.S.;Aljebreen,M.;
Bharany,S.SecureSensitiveData
SharingUsingRSAandElGamal
CryptographicAlgorithmswith
HashFunctions.Information2022,13,
442.https://doi.org/10.3390/
info13100442
AcademicEditor:MaanakGupta
Received:24July2022
Accepted:16September2022
Published:20September2022
Publisher’sNote:MDPIstaysneu‐
tralwithregardtojurisdictional
claimsinpublishedmapsandinstitu‐
tionalaffiliations.
Copyright:©2022bytheauthors.Li‐
censeeMDPI,Basel,Switzerland.
Thisarticleisanopenaccessarticle
distributedunderthetermsandcon‐
ditionsoftheCreativeCommonsAt‐
tribution(CCBY)license(https://cre‐
ativecommons.org/licenses/by/4.0/).
Information2022,13,4422of15
produceaciphertext,whiletheciphertextpassesthroughthedecryptionprocesstopro‐
ducetheplaintext.
Figure1.Abasicillustrationoftheencryptionanddecryptionprocess.
Adigitalsignatureisamessage’sauthenticityandlegalitygeneratedviaacrypto‐
graphicprocess(acontrasttoadigitalcertificate),device,orelectronicrecord[6].Adigital
signatureisadigitalequivalenttoasignedsignatureorengravedseal,butithasmuch
moreessentialprotection.Itismeanttoaddresstheissueofinterferenceandspoofingin
communicationsnetworks.Digitalsignaturescanprovideadditionalguaranteesabout
thesource,presence,andpositionofanelectronicdocument,activity,orcommunication,
aswellasacknowledgethesigner’spermission.Digitalsignaturesareasegmentofdigital
signaturetechnologiesthatsigndocumentsusingkeysandencryptionalgorithms[7].The
digitallysignedalgorithmschemeisoneofthemostwell‐knowndigitalsignaturesys‐
tems,e.g.,theRSAdigitalsigningscheme,theElGamaldigitalsigningscheme,andmany
othersbasedonpublickeycryptosystems.Thisstudy,therefore,aimsatimplementing
theRSAandElGamalcryptographicalgorithmsusingthehashfunctiontoensuredata
securitywithintegrity.Inaddition,thisstudyattemptstoestablishthedataintegrityof
RSAandElGamalcryptographicproceduresthatusethecreationandvalidationofsig‐
natures.Thisstudywillbebeneficialforcontrollingcryptographicoperationsusingthe
sender’sandreceiver’sprivateandpublickeys.
Thisstudyconsistsoffoursections.Wefirstdescribetheliteraturereviews.Thema‐
terialsandmethodsusedaredescribedinSection2.Sections3and4presenttheresults
anddiscussion.Section5concludesthestudy.
ReviewofLiterature
Zhangetal.[8]demonstratedanimprovedschemeusingamodernmainagreement
protocolovertheChangandChang[9]system,whichdoesnotuseaone‐wayhashing
algorithmorreplicationpadding.Digitalsignaturesystemsdependentonpublic‐key
cryptosystemsaresusceptibletoexistentialidentityfraudattacks,whichcanbeavoided
byusingaone‐wayhashfeature.Theauthorsofthispapersuggestafraudulentassault
onthedigitalsignaturesystemproposedbyChangandChangin2004.
Burr[10]studiedthepossibilitiesofcryptographichashfunctionsinhisarticle.He
emphasizedthatthecryptographytoolsincludetheSHA‐1andSHA‐2functions.Apart
fromDobbertin’sworkaftertheMD5near‐breakin1996,hashfunctionassessmentsaw
littledevelopmentuntilthemiddleof2004.Sincethen,someacademicshavefocusedon
almostalloftheoriginalhashfunctions,includingSHA‐1.Theseattacksshookcryptog‐
raphers’long‐termfaithinalmostallhashfunctionsbecauseSHA‐2functionsare,even
untilnow,relatedtotheearlierbrokenfunctionsbuilt.Althoughcryptologistshavedis‐
coveredalotoverthepastfewyearsconcerninghashfunctionsandhowtoattackthem,
cryptanalystswidelyconcludedthatrealisticthreatstoSHA‐2hashfunctionsremainim‐
possibleinthenextdecades.
Acharyaetal.[11],intheirpaper,discussedandanalyzedsomewell‐knowncrypto‐
graphicalgorithmstoshowthefundamentalvariationsbetweencurrentdataencryption
methods.Despitethecomputationalphilosophybehindsuchanalgorithm,theeffective
techniquesarewellknownandwelldocumentedsincetheyhavebeenthoroughlyre‐
viewedandanalyzed.Theynotedthatthepowerofcryptographyisinthekeyselection;
longerkeysresistassaultmoreeasilythanshorterkeys.Nobodycanguaranteecomplete
defense.
Information2022,13,4423of15
SalehandMeinel’s[12]HPISecureisasuggestedHTTPclientthatisinchargeof
encryptingordecryptinginformation.Itmustbemountedontheclient’scomputer.Italso
transmitsHTTPrequest/responseitemsandencryptsdatabeforesendingittothenet‐
workordecryptstheinformationsentbackfromthenetwork.Theywereinfavorofusing
public‐keyencryption.Besidesthat,tomakeitharderforunauthorizeduserstouseacol‐
lectionofsecretkeys,eachrecordcanbeencodedwithadifferentkey.Ontheotherhand,
theyrecommendusingacoordinatorforkeymanagement,whichmaybeathird‐party
cloudserviceoraUSBthatstoresthecredentialsandassociatedmaterial[13,14].Con‐
versely,oneofthedrawbacksofthisresearchisthattheclientmustinstalltheprogram
oneachcomputerwhereitwillbeused.Theyalsorestrictedinformationsharingandco‐
ordinationamonggroupsofindividuals.
Hwangetal.[15]suggestedacloudinfrastructurebusinessstrategybuiltontheprin‐
cipleofhavingtwoindependentserviceproviders,oneforcryptographyandanotherfor
processing.Thedatabasesystemretainsencodeduserinformationandkeyswhilethe
cryptographicservicemodelrequirescipheringactivitiesandthenerasestheinformation.
Thekeyideabehindtheirstrategyistodividetheprocedureamongmultipleservicepro‐
viderstoreducetheoperatingcostofrevealinguserinformation.Thereisnocertainty,
though,thatthecryptographicservicesystemfullyerasestheinformationanddoesnot
preserveoruseit.Moreover,Chandraetal.’s[16]Silverlineisatechniquethathasbeen
implementedtofacilitateimproveddataprotectioninthecloud.Unlikethepreceding
methods,theseauthorsconcentratedondataandcomputation‐intensivesoftware.Their
primaryaimwastoencryptasmuchusefulinformationaspossiblewithoutinterfering
withtheapplication’sfeatures.Asaresult,althoughthecloudprogramcannotcompute
anydataitcannotcontrolinplaintext,theyproposeddecodingonlytheinformationthat
isnotusedinthecomputation.
Haqueetal.’s[17]studyprovidedacomprehensiveperformanceanalysisinwhich
commonsymmetricalandasymmetricalkeyencryptionmethodswerecomparedto
choosetheonethatworkedbestforhandheldphonesandresource‐constrainedenviron‐
ments.Variousfactors,includingkeysize,datablocks,datatype,andCPUtime,were
usedtocomparetheAES,RC4,Blowfish,CAST,3DES,Twofish,DSA,andElGamalalgo‐
rithms.Theexperimentsshowtheutilityofseveralcryptographicalgorithmsforusein
practicalapplicationsinwhichquickexecutionandlittlememoryusageareessential.
Dijeshetal.[18]workedonanasymmetrickeyschemeforenhancinge‐commerce
protection.Thestudyexplainsasymmetricaltechniquestomakeuseofelectroniccom‐
mercepaymentsandothersupportivecryptographictechniquesthatarecrucialtothe
operationofelectronicbusiness.Thepaperalsooutlinesthemainsecurityissueswith
onlineshopping.Basedonsecurity,theRSAencryptionalgorithmandtheFernetcipher
encryptionalgorithmwereproposedasmultilayerencryptionalgorithms.Acomprehen‐
siveandintricatetechniqueforencryptionwasbuiltusingamultilayerencryption
method.Thestudyconcludedthattheproposedmultilayerencryptiondiscussedwasthe
mainmethodformakingonlinetransactionssecure.Amoreadvancedencryptiontech‐
niquecanquicklyandefficientlyreducefraudulentoperations.
HamzaandAl‐Alak[19]analyzedseveralasymmetrickeygeneratorsinwirelesssen‐
sornetworks.Althoughtheasymmetrickeyencryptionalgorithmprovidesahigherlevel
ofsecuritythansymmetrickeyencryption,itrequiresmoresensorsthansymmetrickey
encryption.Thetwelvealgorithmtrials’chainkeysweregeneratedusingtheKCMA
method(ECC,RSA,ElGamal).ThesechainswerethencombinedusingtheSHA‐2and
XORhashingalgorithms.Thediehardtestwasusedinallteststoassessthesecretkey’s
unpredictabilityanddemonstrateitsincreasedsecurity.WhencomparedtoXOR,SHA‐2
performedthebest.Table1givesasummaryofalltheliteraturereviewedwiththeresults
theyachieved.
Information2022,13,4424of15
Table1.Summaryofliterature.
S/NAuthorMethodsResultLimitations
1Zhangetal.[8]Digitalsignaturealgorithm
Theauthorsproposed
DSAtomitigatefraudu‐
lentassault.
Onlydigitalsignature
wasused.
2Burr[10]SHA‐1andSHA‐2
Thestudyconcludedthat
realisticthreatstoSHA‐2
hashfunctionsremain
impossibleinthenext
decades.
Thestudyonlyprotects
theintegrityofdatabut
doesnotproperlysecure
thedata.
3Acharyaetal.[11]Analyzedsomewell‐knowncryp‐
tographicalgorithms
Thestudynotedthatthe
powerofcryptographyis
inthekeyselection.
Thestudylacksaproper
waytoensurecomplete
datasecurity.
4SalehandMeinel
[12]
HPISecurewasusedtosecurethe
HTTPclient.
Thestudyrecommends
usingacoordinatorfor
keymanagement.
Thedrawbackofthisre‐
searchisthattheclient
mustinstalltheprogram
oneachcomputerwhere
itwillbeused.
5Haqueetal.[17]AES,RC4,Blowfish,CAST,3DES,
Twofish,DSA,andElGamal
Theeffectivenessofanal‐
gorithmdependsonexe‐
cutiontimeandlower
memoryusagerequire‐
ment.
Thestudyonlycompares
thecomputationaltimeof
theselectedalgorithms.
6Dijeshetal.[18]
Multilayerencryptionalgorithm
RSAandFernetcipherencryption
algorithms
Themethodusedtode‐
creasefraudulentactivi‐
tieseasilyandeffectively
overtheinternet.
Thestudyrecommendsa
moreefficientalgorithm
tosecureonlinetransac‐
tions.
7HamzaandAl‐Alak
[19]
KCMAforkeygeneration(ECC,
RSA,ElGamal)withSHA‐1and
SHA‐2
SHA‐2wasthebestas
comparedwithXOR.
Thestudyonlycompares
thekeygenerationofen‐
cryptionalgorithmswith
thehashingfunction.
Fromthesummaryofpiecesofliteratureshowingvariouslimitationsofthereviewed
work,itisexpedienttoprofferasolutionthatwillenhancethesecurityofdataaswellas
increasetheintegrityofthemessage.Therefore,thisstudyembracedtheuseofRSAand
ElGamalalgorithmswithSHA‐256toenhancetheintegrityofdata.
2.MaterialsandMethods
Thisstudyusesasymmetriccryptography(theRSAandElGamal)andtheSHA‐256
hashfunctionforboththeencryptionandsharingofsensitiveinformationandusinga
digitallysignedsystem;securityfeaturesincludingmessageauthentication,datainteg‐
rity,non‐repudiation,andconfidentialityarealsoprovided.Foranyspecifiedciphertext
regardlessoflength,theSHA‐256hashtechniqueisemployedtoproduceafixed,singular
value(referredtoasamessagedigest).Itisthismessagedigestthatissubsequentlyen‐
crypted/signedtoproducethesignaturesforthemessage.Thesystemflowdiagramof
thesystemisdisplayedinFigure2,whichdisplaystheflowofinformationfromuserA
touserB.
Information2022,13,4425of15
Figure2.Systemflowdiagram.
Thesystemisdevelopedinsuchawaythattherecipientalsorecomputesthedigital
signaturetoensureitsintegrityafterthesenderproducesitusingSHA‐256.Theauthen‐
ticityofthecontentisdeterminedifthetwosignaturesfromtheoriginatorandtherecip‐
ientareequal;ifnot,thedatahavebeenchangedduringtransitortransmission.
2.1.TheRSAAlgorithm
TheRSA’sreliabilityisdependentonhowchallengingitistofactorhugeprimenum‐
bers.TheencryptionanddecryptionstagesoftheRSAalgorithminvolvemodularexpo‐
nentiation.
2.1.1.KeyGeneration
i. Randomlychoosetwohuge,uniqueprimespandq.
ii. Computethemodulusn,n=p*qandthephifunctionØ(n)=(p−1)*(q−1).
iii. Choosearandomintegere,suchthat0<e<Ø(n).
iv. Computed=eˉˡmodØ(n).
v. Theprivatekeyisgivenas(d,n)andthepublickeyas(e,n).
2.1.2.EncryptionandDecryption
GiventhemessagetobeMandthecipherC,
i. Encryptioniscarriedoutwiththeaidofthepublickey(e,n).
ii. C=Mᵉmodn.
iii. Thesecretkeyisusedfordecryption(d,n).
iv. M=Cmodn.
2.2.SigningandVerification
Thecommunicatormustcarryoutthefollowingtocreatethesignaturesfordocu‐
mentM:
i. Calculatethehashh=H(M)ofthemessageM.
ii. ThesignatureSisgivenasS=Hmodn.
Toverifythesignature,
i. CalculatethehashHofthemessageM.
ii. ComputeH’=Sᵉmodn.
iii. IfH==H’,thenthesignatureisvalid.
Anymodificationtothedocumentwouldprovideachangedhashcode,which
wouldnotcorrelatewiththesignature.
Information2022,13,4426of15
2.3.TheElGamalAlgorithm
Dr.TaherElgamaldevelopedtheElGamalalgorithm,whichisapublic‐keymethod
ofencryption.Itisbasedontheone‐wayfeature,whichensuresthatencryptionschemes
areperformedseparately[20–24].
2.3.1.KeyGeneration
i. Generatealargerandomprimenumber(p).
ii. Chooseageneratornumber(a).
iii. Chooseaninteger(x)lessthan(p‐2),asthesecretnumber.
iv. Compute(d),whered=axmodp.
v. Theprivatekeyisgivenas(x)andthepublickeyas(p,a,d).
2.3.2.EncryptionandDecryption
Representtheplaintextasanintegerm,where0<m<p‐1.
Encryptionisachievedusingthepublickey(p,a,d).
i. Chooseanintegerksuchthat1<k<p‐2.
ii. Computey,y=akmodp.
iii. Computez,z=(dk*m)modp.
iv. TheciphertextisgivenasC=(y,z).
Decryptionisachievedusingtheprivatekey(x).
i. ThereceiverobtainstheciphertextC=(y,z).
ii. Next,riscomputedasfollows:r=yp−1‐xmodp.
Theplaintextisrecoveredasfollows:m=(r*z)modp.
2.3.3.SignatureGeneration
ThisisaccomplishedfirstbygeneratingthehashmofthemessageM,withthepri‐
vatekeygivenas(x).
Thesignershouldthenperformthefollowing:
i. ChoosearandomintegerKwith1≤K≤(p‐1)andgcd(K,p‐1)=1.
ii. Computethetemporarykey:h=akmodp.
iii. ComputeK‐1theinverseofKmod(p‐1).
iv. Computethevalues=K−1(m‐xh)mod(p‐1).
v. Thesignatureis(h,s).
AnyotheruserwhoreceivesthemessageMandsignature(h,s)cancarryoutverifi‐
cationusingthepublickey(p,a,d)bycomputingthefollowing:
i. ThehashmforthemessageM;
ii. V1=ammodp;
iii. V2=dhhSmodp;
iv. ThesignatureisvalidifV1==V2.
2.4.TheSHA‐256HashFunction
SHA‐256(securehashalgorithm,FIPS182‐2)isacryptographichashfunctionthat
processesinputblocksof512bitswithadigestlengthof256bits.Itisakeylesshashfunc‐
tion.TheSHA‐256followsthesamemodelasSHA‐1andbeginsbydefiningseveralcon‐
stants[25–29].Severaloperatingsystemsfrequentlyusehashmethodstosecurepass‐
words.Figure3illustrateshowhashingassessesafile’sauthenticity.Figure4showsthe
hashingalgorithmsinvolvingroundsofthehashfunctionsuchasablockcipher[30–33].
Information2022,13,4427of15
Figure3.Abasicillustrationofthehashingprocess.
Figure4.Schematicillustrationofhashingalgorithms.
TheSHA‐256Algorithm
ThealgorithmfortheSHA‐256hashfunctionisgivenbelow:
1. Appendasinglebit,whosevalueissetto1,totheinputx.
2. Computethesmallestrsuchthat(b+r)mod512=448.Appendr‐1bits,whosevalues
aresetto0,totheresultofstep1.
3. Computethe64‐bitvaluebmod2^64andappendthisvaluetotheresultofstep2.
4. Thisyieldsastringoflengththatmustbeamultiple,m,of512bitsand,thus,maybe
representedas16*m32‐bitblocks.
3.Results
Theproposedsecuresensitivedatasharingsystempossessesthefollowingfeatures:
1. EncryptionoffilesusingRSAandElGamalalgorithms;
2. Signaturegenerationandverificationfortextfiles;
3. DecryptionofinformationusingtheRSAandElGamalalgorithms;
4. Generationofmessagedigestforinformation/data;
5. GUIinterfaceforeasyinteractionwiththesystem;
6. Auto‐generationofprivateandpublickeysforencryption,signing,anddecryption;
7. Provisionofinterfacefortheselectionoffilesordocumentstobesignedorencrypted.
SeeFigure5.
Figure5.Applicationhomepage.
Information2022,13,4428of15
Figure5displaystheinterfacethatprovidestheuserwithvariousfunctionalitiesto
encryptandsign,decryptandverify,orgenerateorverifythesignatureofafileafter
generatingorloadingtheappropriatekeysneeded.SeeFigure6.
Figure6.Encryptionandsignaturegenerationtosecuresensitiveinformation.
InFigure6,theuserinputstheirtexttobeencryptedandthenclicksonthe‘Encrypt
andsign’buttontogeneratetheciphertextanddigitalsignatureforthattextinput.Fig‐
ure7;Figure8illustratethedecryptionandsignatureverificationofthefileencrypted
withtheinstanceofFigure7returningavalidsignature,whilethatofFigure8returnsa
messagedialogforaninvalidsignature,whichprovesthateitherthesignaturedoesnot
correspondtothatfileorthefilehasbeenalteredinsomeway[34,35].
Figure7.Decryptionandsignatureverificationreturningavalidsignature.
Information2022,13,4429of15
Figure8.Decryptionandsignatureverificationreturninganinvalidsignature.
3.1.ResultAnalysis
TheRSAandtheElGamalalgorithmsweretestedusing2048‐bitkeys.Thetimetaken
fortheencryption,decryption,signaturegeneration,andverificationmodulesisgivenin
milliseconds.
3.1.1.Encryption
VariousfilesofdifferentsizeswereencryptedusingRSAandElGamalcryptographic
algorithms.Theencryptiontimeofbothalgorithmswasobtainedandplacedinatabular
form.SeeTable2.
Table2.DataanalysisforencryptionprocessforRSAandElGamalalgorithms.
S/NFileSize(Kb)RSAElGamal
EncryptionTime(ms)EncryptionTime(ms)
110953520
2152564340
3203126689
4254767311
5304997834
6355618372
7406069161
850109413
,
215
9100213619,359
10200422944,689
Figure9displaystheencryptiontimeoftheRSAandElGamalprocess,anditsshows
thattheElGamalalgorithmconsumesmoretimeduringdecryptionforvariousfilesizes.
Information2022,13,44210of15
Figure9.GraphicalrepresentationofRSAandElGamalencryptiontime.
3.1.2.Decryption
ThesamefilesizesencryptedinTable2weredecrypted,andtheirvariousdecryption
timesduringthedecryptionprocesswereobtainedandplacedinatabularform.SeeTable
3.
Table3.DataanalysisforthedecryptionprocessforRSAandElGamalalgorithms.
Size(Kb)RSAElGamal
DecryptionTime(ms)DecryptionTime(ms)
1103428637
2155207975
32078091233
42598321807
53012,6922645
63516
,
3253293
74018,5933990
85023
,
9864525
910035,4796829
1020042
,
7089968
Figure10displaysthegraphicalanalysisoftheRSAandElGamaldecryptionprocess
fordifferentfilesizes,andtheanalysisshowsthattheElGamalalgorithmconsumeslesser
timeduringthedecryptionoffilesizescomparedtotheRSAalgorithm.
Information2022,13,44211of15
Figure10.GraphicalanalysisofRSAandElGamaldecryptiontime(ms)
3.1.3.SignatureGeneration
ThetimetakenforbothRSAandElGamaltogenerateasignaturewascapturedand
recorded.Moreover,thetimetakenforRSAandElGamalwithoutSHA‐256wasobtained
andrecordedinatabularform.SeeTable4.
Table4.DataanalysisofsignaturegenerationprocessforRSAandElGamalalgorithms.
FileSize(Kb)
RSASignature
Generation
RSAwithout
SHA‐256
ElGamalSigna‐
tureGeneration
ElGamalwith‐
outSHA‐256
TimeTaken(ms)TimeTaken
(ms)TimeTaken(ms)TimeTaken
(ms)
1104852223136381
2154693405139602
3204844448145823
42549356831381057
53046469441471346
63547380731341871
74048692991362018
85049310,6011462667
910049618
,
8861313243
1020048123,9811364036
Figure11displaysthegraphicalanalysisofthesignaturegeneration.Itshowsthat
ElGamaloutperformsRSAinsignaturegeneration.
Information2022,13,44212of15
Figure11.GraphicalanalysisofRSAandElGamalsignaturegenerationprocess(ms).
3.1.4.SignatureVerification
RSA’sandElGamal’stimetakenforthesignatureverificationprocesswasobtained
andrecorded.ThetimetakenforbothalgorithmswithoutSHA‐256wasobtainedaswell
inmillisecondsanddisplayedintabularform.SeeTable5.
Table5.DataanalysisforsignatureverificationprocessforRSAandElGamalalgorithms.
FileSize
(KB)
RSASignature
Verification
TimeTaken
(ms)
RSAwithout
SHA‐256(ms)
ElGamalSignature
Verification(ms)
ElGamalwith‐
outSHA‐256
(ms)
1101563177827
21515661891281
32012691891630
42514761942057
53015771652718
63515821673152
74019871883770
85015981904234
9100211031795141
10200251221996089
Figure12displaysthegraphicalanalysisofRSAandElGamalsignatureverification.
TheanalysisshowsthatRSAperformsbetterthanElGamalinthesignatureverification
process.
Information2022,13,44213of15
Figure12.GraphicalanalysisofthesignatureverificationprocessofRSAandElGamalalgorithms.
4.Discussion
ThisstudyexaminedtheRSAandElGamalcryptographicalgorithmstoimprovein‐
formationsecurity.TheapplicationoftheSHA‐256hashfunctiontothedigitalsignatures
oftheRSAandElGamalasymmetriccryptographicalgorithmswasimplemented.From
thevariousexperimentalresultsdisplayedintablesandfigures,itcanbeseenthatthe
RSAalgorithmperformsbetterthantheElGamalduringtheencryptionandsignature
verificationprocesses,whileElGamalperformsbetterthanRSAduringthedecryption
andsignaturegenerationprocess.Therefore,itcanbededucedthateachofthealgorithms
performsbetterthantheotherinsomeprocesses;however,thereisnoobvioussuperiority
ofonecryptosystemovertheotherinalltheprocessesofencryption,decryption,signa‐
turegeneration,andsignatureverification.
FindingsandComparisonwithExistingWork
Theuseofcryptographichashfunctionsindigitalsignaturegenerationprovidesa
mechanismsuchthattheintegritycheckfeatureofthehashvalueguaranteesapartyof
theintegrityandoriginalityofadocumentordata;thefindinginthisstudycorroborates
thatofHamzaandAl‐Alak[19].Signingthehashvalueofdatawiththeuseofhashfunc‐
tions,insteadofsigningthedatadirectlyprovidesamoreefficientschemeforadigital
signaturebecausethehashofthedataisarelativelysmallervaluecomparedtotheorigi‐
naldata,inaccordancewithBurr[10].ThisfindinginthisstudymatchesthatofHaqueet
al.’s[17]study.However,Haqueetal.’s[17]studywasoutperformedbyimplementing
SHA‐256toachievedataintegrity.
5.Conclusions
Theneedforinformationsecurityinthispresenttimehasbecomenon‐negligiblein
oursocietyduetothedailyincreasingemergenceofcybercrimes,piracy,scam,andfraud
cases.Asithasbeennoticedthatsecurityandsafetyconcernsareamongthemostpressing
problemsconfrontingpotentialdistributeddata,thesendingandreceptionofdataare
consideredvulnerabletoexternalattacks.Therefore,dataprotectionthroughencryp‐
tion/decryptionisessential.Thisstudyexaminedtwoasymmetricalgorithms(RSAand
ElGamal)developedinimprovinginformationsecurityservices.Inaddition,theapplica‐
tionoftheSHA‐256hashfunctiontothedigitalsignaturesoftheRSAandElGamalcryp‐
tosystemswasimplementedtoestablishinformationintegrity.Thetechniqueensuresthe
protectionofthesecurityofusers’sensitivedataandatthesametimeprovidesuserswith
Information2022,13,44214of15
fullcontroloftheirdata.Variousbenefitsassociatedwiththisstudyandthecorrectness
oftheimplementedsystemsmakeitsuitableforanysecuresensitivedatasharingsystem.
Therefore,itisrecommendedthatfurtherimplementationsuchassecuresubmission,
storage,andextractionoperationsofthesensitivedatasharingsystemshouldbeimple‐
mentedforfullandmaximumprotectionofsensitivedata.
AuthorContributions:Conceptualization,E.A.A.,P.B.F.andS.B.;methodology,E.A.A.,P.B.F.and
S.B.;software,E.A.A.,P.B.F.andS.B.;validation,E.A.A.,P.B.F.andS.B.;formalanalysis,M.S.M.,
M.A.andS.B.;investigation,E.A.A.andP.B.F.;resources,M.S.M.,M.A.andS.B.,datacuration,S.B.;
writing—originaldraftpreparation,E.A.A.andS.B.;writing—reviewandediting,E.A.A.andS.B.;
visualization,E.A.A.andS.B.;supervision,M.S.M.,M.A.andS.B.;projectadministration,M.S.M.,
M.A.andS.B.Allauthorshavereadandagreedtothepublishedversionofthemanuscript.
Funding:ThisresearchwasfundedbytheResearchSupportingProject(numberRSP2022R459),
KingSaudUniversity,Riyadh,SaudiArabia.
InstitutionalReviewBoardStatement:Notapplicable.
InformedConsentStatement:Notapplicable.
DataAvailabilityStatement:Notapplicable.
Acknowledgments:ResearchSupportingProject(numberRSP2022R459),KingSaudUniversity,Ri‐
yadh,SaudiArabia.
ConflictsofInterest:Theauthorsdeclarenoconflictofinterest.
References
1. Gunduz,M.Z.;Das,R.Cyber‐securityonsmartgrid:Threatsandpotentialsolutions.Comput.Netw.2020,169,107094.
https://doi.org/10.1016/j.comnet.2019.107094.
2. Saxena,N.;Choi,B.J.;Lu,R.AuthenticationandAuthorizationSchemeforVariousUserRolesandDevicesinSmartGrid.
IEEETrans.Inf.ForensicsSecur.2015,11,907–921.https://doi.org/10.1109/tifs.2015.2512525.
3. Misbha,A.;Baswal,K.;Simha,M.N.;Abujam,R.;C.M.,S.GUPTDOCANENTERPRISEPORTALFORCRYPTINGWITH
AES.Int.Res.J.Eng.Technol.2017,4,1309–1311.
4. Emmanuel,A.A.;Okeyinka,A.E.;Adebiyi,M.O.;Asani,E.O.ANoteonTimeandSpaceComplexityofRSAandElGamal
CryptographicAlgorithms.Int.J.Adv.Comput.Sci.Appl.2021,12,143–147.
5. Chandra,S.;Paira,S.;Alam,S.S.;Sanyal,G.AcomparativesurveyofSymmetricandAsymmetricKeyCryptography.In
Proceedingsofthe2014InternationalConferenceonElectronics,CommunicationandComputationalEngineering
(ICECCE),Hosur,India,17–18November2014;pp.83–93.https://doi.org/10.1109/icecce.2014.7086640.
6. Sejfuli‐Ramadani,N.TheRoleandtheImpactofDigitalCertificateandDigitalSignatureinImprovingSecurityDuring
DataTransmission.Eur.J.Sustain.Dev.Res.2017,2,116–120.
7. Winter,C.;Berchtold,W.;Hollenbeck,J.N.Securingphysicaldocumentswithdigitalsignatures.InProceedingsofthe2019
IEEE21stInternationalWorkshoponMultimediaSignalProcessing(MMSP),KualaLumpur,Malaysia,18November2019;
pp.1–6.
8. Zhang,H.;Yuan,Z.;Wen,Q.Y.ADigitalSignatureSchemesWithoutUsingOne‐wayHashandMessageRedundancyand
ItsApplicationonKeyAgreement.InProceedingsofthe2007IFIPInternationalConferenceonNetworkandParallelCom‐
putingWorkshops(NPC2007),Dalian,China,18–21September2007;pp.873–878.https://doi.org/10.1109/ic‐
npcw.2007.4351597.
9. Chang,C.C.;Chang,Y.F.Anovelthree‐partyencryptedkeyexchangeprotocol.Comput.Stand.Interfaces2004,26,471–476.
https://doi.org/10.1016/j.csi.2003.12.001.
10. Burr,W.Cryptographichashstandards:Wheredowegofromhere?.IEEESecur.Priv.2006,4,88–91.
https://doi.org/10.1109/msp.2006.37.
11. Acharya,K.;Sajwan,M.;Bhargava,S.AnalysisofCryptographicAlgorithmsforNetworkSecurity.Int.J.Comput.Appl.
Technol.Res.2014,3,130–135.
12. Saleh,E.;Meinel,C.HPISecure:TowardsDataConfidentialityinCloudApplications.InProceedingsofthe201313th
IEEE/ACMInternationalSymposiumonCluster,Cloud,andGridComputing,Delft,Netherlands,13–16May2013;pp.605–
609.https://doi.org/10.1109/ccgrid.2013.109.
13. Mell,P.;Grance,T.TheNISTdefinitionofcloudcomputing.NISTSpec.Publ.2011,800,145.
14. Abiodun,M.K.;Awotunde,J.B.;Ogundokun,R.O.;Misra,S.;Adeniyi,E.A.;Arowolo,M.O.;Jaglan,V.CloudandBigData:
AMutualBenefitforOrganizationDevelopment.J.Physics:Conf.Ser.2021,1767,012020.https://doi.org/10.1088/1742‐
6596/1767/1/012020.
Information2022,13,44215of15
15. Hwang,J.J.;Chuang,H.K.;Hsu,Y.C.;Wu,C.H.ABusinessModelforCloudComputingBasedonaSeparateEncryption
andDecryptionService.InProceedingsofthe2011InternationalConferenceonInformationScienceandApplications,Jeju,
Korea,26–29April2011;pp.1–7.https://doi.org/10.1109/icisa.2011.5772349.
16. Chandra,D.G.;Prakash,R.;Lamdharia,S.AStudyonCloudDatabase.InProceedingsofthe2012FourthInternational
ConferenceonComputationalIntelligenceandCommunicationNetworks,Mathura,India,3–5November2012;pp.513–
519.
17. Haque,E.;Zobaed,S.;Islam,M.U.;Areef,F.M.PerformanceAnalysisofCryptographicAlgorithmsforSelectingBetter
UtilizationonResourceConstraintDevices.InProceedingsofthe201821stInternationalConferenceofComputerandIn‐
formationTechnology(ICCIT),Dhaka,Bangladesh,21–23December2018;pp.1–6.https://doi.org/10.1109/ic‐
citechn.2018.8631957.
18. Dijesh,P.;Babu,S.;Vijayalakshmi,Y.Enhancementofe‐commercesecuritythroughasymmetrickeyalgorithm.Comput.
Commun.2020,153,125–134.https://doi.org/10.1016/j.comcom.2020.01.033.
19. Hamza,A.H.;Al‐Alak,S.M.K.Evaluationkeygeneratorofmultipleasymmetricmethodsinwirelesssensornetworks
(WSNs).J.Phys.Conf.Ser.2021,1804,012096.
20. Bharany,S.;Sharma,S.;Badotra,S.;Khalaf,O.I.;Alotaibi,Y.;Alghamdi,S.;Alassery,F.Energy‐EfficientClusteringScheme
forFlyingAd‐HocNetworksUsinganOptimizedLEACHProtocol.Energies2021,14,6016.
https://doi.org/10.3390/en14196016.
21. Kaur,K.;Bharany,S.;Badotra,S.;Aggarwal,K.;Nayyar,A.;Sharma,S.Energy‐efficientpolyglotpersistencedatabaselive
migrationamongheterogeneousclouds.J.Supercomput.2022,1–30.https://doi.org/10.1007/s11227‐022‐04662‐6.
22. Bharany,S.;Sharma,S.;Bhatia,S.;Rahmani,M.K.I.;Shuaib,M.;Lashari,S.A.EnergyEfficientClusteringProtocolfor
FANETSUsingMothFlameOptimization.Sustainability2022,14,6159.https://doi.org/10.3390/su14106159.
23. Steichen,M.;FizPontiveros,B.;Norvill,R.;Shbair,W.Blockchain‐Based,DecentralizedAccessControlforIPFS.InProceed‐
ingsofthe2018IEEEInternationalConferenceonBlockchain(Blockchain‐2018),Halifax,NS,Canada,30July–3August
2018;pp.1499–1506.
24. Gaby,G.;Chandra,L.;Enderson,T.TowardsSecureInteroperabilitybetweenHeterogeneousBlockchainsusingSmartCon‐
tracts.InProceedingsoftheFutureTechnologiesConference(FTC),Vancouver,BC,Canada,15–16November2017;pp.73–
81.
25. Bharany,S.;Sharma,S.;Khalaf,O.I.;Abdulsahib,G.M.;AlHumaimeedy,A.S.;Aldhyani,T.H.H.;Maashi,M.;Alkahtani,H.
ASystematicSurveyonEnergy‐EfficientTechniquesinSustainableCloudComputing.Sustainability2022,14,6256.
https://doi.org/10.3390/su14106256.
26. Nizamuddin,N.;Salah,K.;Azad,M.A.;Arshad,J.;Rehman,M.Decentralizeddocumentversioncontrolusingethereum
blockchainandIPFS.Comput.Electr.Eng.2019,76,183–197.https://doi.org/10.1016/j.compeleceng.2019.03.014.
27. Bharany,S.;Kaur,K.;Badotra,S.;Rani,S.;Kavita;Wozniak,M.;Shafi,J.;Ijaz,M.F.EfficientMiddlewareforthePortability
ofPaaSServicesConsumingApplicationsamongHeterogeneousClouds.Sensors2022,22,5013.
https://doi.org/10.3390/s22135013.
28. Guo,R.;Shi,H.;Zhao,Q.;Zheng,D.SecureAttribute‐BasedSignatureSchemeWithMultipleAuthoritiesforBlockchainin
ElectronicHealthRecordsSystems.IEEEAccess2018,6,11676–11686.https://doi.org/10.1109/access.2018.2801266.
29. Bharany,S.;Badotra,S.;Sharma,S.;Rani,S.;Alazab,M.;Jhaveri,R.H.;Gadekallu,T.R.Energyefficientfaulttolerancetech‐
niquesingreencloudcomputing:Asystematicsurveyandtaxonomy.Sustain.EnergyTechnol.Assess.2022,53,102613.
https://doi.org/10.1016/j.seta.2022.102613.
30. Dias,J.P.;Reis,L.;Ferreira,H.S.;Martins,Â.Blockchainforaccesscontroline‐healthscenarios.arXiv2018,arXiv:1805.12267.
31. Bharany,S.;Sharma,S.;Frnda,J.;Shuaib,M.;Khalid,M.I.;Hussain,S.;Iqbal,J.;Ullah,S.S.WildfireMonitoringBasedon
EnergyEfficientClusteringApproachforFANETS.Drones2022,6,193.https://doi.org/10.3390/drones6080193.
32. Fukumitsu,M.;Hasegawa,S.;Iwazaki,J.;Sakai,M.;Takahashi,D.AproposalofasecureP2P‐typestorageschemebyusing
thesecretsharingandtheblockchain.InProceedingsofthe2017IEEE31stInternationalConferenceonAdvancedInfor‐
mationNetworkingandApplications(AINA),Taipei,Taiwan,27–29March2017;pp.803–810.
33. Pãnescu,A.T.;Manta,V.SmartContractsforResearchDataRightsManagementovertheEthereumBlockchainNetwork.
Sci.Technol.Libr.2018,37,235–245.https://doi.org/10.1080/0194262x.2018.1474838.
34. Dai,M.;Zhang,S.;Wang,H.;Jin,S.ALowStorageRoomRequirementFrameworkforDistributedLedgerinBlockchain.
IEEEAccess2018,6,22970–22975.https://doi.org/10.1109/access.2018.2814624.
35. Nizamuddin,N.;Hasan,H.;Salah,K.;Iqbal,R.Blockchain‐BasedFrameworkforProtectingAuthorRoyaltyofDigitalAs‐
sets.Arab.J.Sci.Eng.2019,44,3849–3866.https://doi.org/10.1007/s13369‐018‐03715‐4.