AES Encryption na Decryption Kumurongo

Igenamigambi Ryambere (AES) ni ibanga rya algorithm. AES ninganda zinganda nkubu nkuko yemerera 128 bit, 192 bit na 256 bits encryption. Symmetric encryption irihuta ugereranije na encryption idasanzwe kandi ikoreshwa muri sisitemu nka sisitemu yububiko. Ibikurikira nigikoresho cyo kumurongo kugirango ukore AES encryption na decryption yibintu byose byanditse-ijambo ryibanga.

Igikoresho gitanga uburyo bwinshi bwo kugenzura no gufungura nka Uburyo bwa ECB, CBC, CTR, CFB na GCM. GCM ifatwa nkumutekano kuruta uburyo bwa CBC kandi byemewe cyane kubikorwa byayo.

Kubindi bisobanuro kuri AES encryption, sura ibi bisobanuro kuri Encryption ya AES. Hasi nuburyo bwo gufata inyongeramusaruro no gushishoza.

AES Encryption

Base64 Hex

AES Kubanga

Base64 Ikibaya

Agaciro kingenzi kingenzi winjiye, cyangwa twabyaye ntabwo kibitswe kururu rubuga, iki gikoresho gitangwa hifashishijwe URL ya HTTPS kugirango umenye neza ko urufunguzo rwibanga rudashobora kwibwa.

Niba ushima iki gikoresho noneho urashobora gutekereza gutanga.

Turashimira inkunga yawe idashira.

Ibintu by'ingenzi

  • Ikimenyetso Urufunguzo rwa Algorithm: Urufunguzo rumwe rukoreshwa muburyo bwo gushishoza no gufungura.
  • Hagarika Cipher: AES ikorera kumurongo uhamye wamakuru. Ingano isanzwe yo guhagarika ni 128 bits.
  • Uburebure bw'ingenzi: AES ishyigikira uburebure bwingenzi bwa 128, 192, na 256 bits. Umwanya muremure urufunguzo, nugukomeza ibanga.
  • Umutekano: AES ifatwa nkumutekano cyane kandi ikoreshwa cyane muri protocole yumutekano itandukanye.

AES Encryption Amagambo & Terminologies

Kuri encryption, urashobora kwinjiza inyandiko isanzwe cyangwa ijambo ryibanga ushaka gushishoza. Noneho hitamo guhagarika cipher uburyo bwo kugenzura.

Uburyo butandukanye bushyigikiwe bwa AES Encryption

AES itanga uburyo bwinshi bwo gushishoza nka ECB, CBC, CTR, OFB, CFB na GCM.

  • ECB (Igitabo cya elegitoroniki Igitabo) nuburyo bworoshye bwo kugenzura kandi ntibisaba IV kubanga. Iyinjiza risanzwe ryanditse rizagabanywamo ibice kandi buri gice kizahishwa hamwe nurufunguzo rwatanzwe bityo ibice bisa byanditse bihishe muburyo bumwe bwa cipher.

  • Uburyo bwa CBC (Cipher Block Chaining) burasabwa cyane, kandi nuburyo bwambere bwo guhagarika cipher encryption. Irasaba IV kugirango buri butumwa bwihariye busobanure ibisobanuro bisa byanditse byanditse byanditse muburyo butandukanye bwa cipher. Kubwibyo, itanga ibanga rikomeye ugereranije nuburyo bwa ECB, ariko biratinda gato ugereranije nuburyo bwa ECB. Niba nta IV yinjiye noneho isanzwe izakoreshwa hano kuburyo bwa CBC kandi isanzwe kuri zeru ishingiye kuri byte [16].

  • CTR (Counter) CTR uburyo (CM) buzwi kandi nkuburyo bwo kubara (ICM) hamwe nuburyo butandukanye (SIC). Counter-mode ihindura cipher yo guhagarika cipher. Ubwoko bwa CTR bufite imiterere isa na OFB, ariko kandi iremera imitungo idasanzwe mugihe cyo gufungura. Ubwoko bwa CTR bukwiranye no gukora kumashini itunganya ibintu, aho ibibuza bishobora guhishirwa muburyo bubangikanye.

  • GCM (Galois / Uburyo bwa Counter) ni impuzamikorere-urufunguzo rwimikorere ya cipher yuburyo bukoresha ikoresha kwihuta kwisi yose kugirango itange ibanga ryemewe. GCM ifatwa nkumutekano kuruta uburyo bwa CBC kuko yubatswe mu kwemeza no kugenzura ubunyangamugayo kandi ikoreshwa cyane mubikorwa byayo.

Padding

Kuri AES uburyo bwa CBC na ECB, padi irashobora kuba PKCS5PADDING na NoPadding. Hamwe na PKCS5Padding, umugozi wa 16-byte uzatanga umusaruro wa 32-byte (ubutaha bukurikira bwa 16).

AES GCM PKCS5Padding ni kimwe na NoPadding kuko GCM nuburyo bwo gutembera budasaba padi. Ciphertext muri GCM ni ndende gusa nkuko bisanzwe. Kubwibyo, nopadding nubusanzwe byatoranijwe.

Ingano y'ingenzi ya AES

Algorithm ya AES ifite ubunini bwa 128-bit, utitaye ko uburebure bwawe bwingenzi ari 256, 192 cyangwa 128 bit. Iyo uburyo bwa cipher simmetrike busaba IV, uburebure bwa IV bugomba kuba bungana nubunini bwa cipher. Kubwibyo, ugomba guhora ukoresha IV ya 128 bits (16 bytes) hamwe na AES.

AES Urufunguzo rwibanga

AES itanga 128 bits, 192 bits na 256 bits yubunini bwurufunguzo rwibanga. Niba urimo guhitamo 128 bits kugirango uhishe, noneho urufunguzo rwibanga rugomba kuba rufite 16 bits z'uburebure na 24 na 32 bits kuri 192 na 256 bits zingana. Kurugero, niba urufunguzo runini ari 128, noneho urufunguzo rwibanga rwemewe rugomba kuba rwinyuguti 16 ni ukuvuga, 16 * 8 = 128 bits