Cov txheej txheem:

Nkag Siab Cov Ntaub Ntawv Tsiv Mus Los: 7 Kauj Ruam
Nkag Siab Cov Ntaub Ntawv Tsiv Mus Los: 7 Kauj Ruam

Video: Nkag Siab Cov Ntaub Ntawv Tsiv Mus Los: 7 Kauj Ruam

Video: Nkag Siab Cov Ntaub Ntawv Tsiv Mus Los: 7 Kauj Ruam
Video: Mang Vang - lam mus kawm ntawv [Official Video] 2019 2024, Kaum ib hlis
Anonim
Encrypted File Movement
Encrypted File Movement

Ib xyoos dhau los kuv yog ib feem ntawm txoj haujlwm. Peb xav tau txav qee cov ntaub ntawv rhiab thoob plaws lub tebchaws.

Kuv yuav mus hla keeb kwm yav dhau ntawm vim li cas, xav tias dawb hla mus rau qib 1.

Cov keeb kwm yav dhau:

Kuv pab neeg tau raug hu los ntawm qhov ceeb toom luv luv kom rov qab kho lub computer los ntawm ib tus tswv cuab hauv pab pawg tau rov ua dua. Feem ntau ntawm lub khoos phis tawj yog koj li ntaub ntawv ib txwm, cov ntawv sau feem ntau. Raws li kuv tab tom hla lub khoos phis tawj kuv pom cov ntawv, ntawm lub zog tsav uas muaj cov ntaub ntawv ua haujlwm tsis raug.

Tom qab tshaj tawm rau cov neeg saum toj no kuv thiab ob peb qhov kev sib cav vim li cas cov ntaub ntawv no tsis tuaj yeem xa email nws tau txiav txim siab txav nws lub cev. Tab sis qhov no yuav tsum tau ua nyob rau hauv ib txoj kev uas tsis tuaj yeem tso cai cov ntaub ntawv los cuam tshuam hauv kev hla.

Cov xwm txheej txav cov ntawv yog:

Tsis muaj kev sib txuas hauv network, tus tswv lub khoos phis tawj tsis tau txuas nrog lub network thiab cov ntaub ntawv no yuav muab khaws cia rau ntawm lub cuab yeej uas tsis txuas nrog lub network.

Yog li siv USB.

Yog tias cov ntaub ntawv poob hauv kev xa mus, koj tsis tuaj yeem ntsaws nws rau hauv computer thiab nkag mus tau. Koj kuj tseem tsis tuaj yeem yuam lub cuab yeej siv.

Cov ntaub ntawv yuav tsum tau muab zais, tom qab ntawd faib ua 4. Txhua 1/4 yuav mus ntawm USB sib txawv. Nrog tus yuam sij ntawm 5.

5 USB sib txawv nrog qhov sib txawv ntawm txhua tus. Nco tseg txoj hauv kev no yuav ua haujlwm nrog 1 USB tsuas yog hla qhov sib cais thiab rov ua dua cov kauj ruam.

Kauj Ruam 1: Koj Xav Tau Dab Tsi?

Koj Xav Tau Dab Tsi?
Koj Xav Tau Dab Tsi?

Lub hom phiaj yog kom qhov no yooj yim. Tab sis yog tias koj tseem tsis paub meej muaj ZIP qhov kawg nrog tus lej.

Txhua software yog pub dawb. Nws tseem ua los ntawm cov cai hauv kev qhia.

Nab hab sej 3

Pib paub. Saib qhov link hauv qab no. Koj tsuas yog xav paub yuav ua li cas rau nruab modules.

www.pythonforbeginners.com/basics/python-p…

Peb yuav muab tag nrho peb cov ntaub ntawv tso rau hauv 1 phau ntawv qhia rau kev yooj yim.

Kauj Ruam 2: PIP hauv Cov Qauv

Hauv Command Prompt rau Windows nkag mus:

pip nruab cryptography

lossis Terminal rau Linux/OSX nkag mus:

pip3 nruab cryptography

Kauj Ruam 3: Tsim Tus Ntsuj Plig

Tsim tus yuam sij
Tsim tus yuam sij

Ntau yam zoo li xauv peb cov ntaub ntawv encrypted yuav xav tau tus yuam sij los qhib nws. 'password123' yuav tsis muaj kev nyab xeeb rau cov ntaub ntawv no (yog tias yog koj tus password, mus hloov nws… tam sim no.)

Peb tab tom yuav muaj tus yuam sij tsim rau peb.

Tsim daim nplaub tshev rau tag nrho koj cov ntawv sau sej kom khaws cia. Tsim cov ntawv tshiab, Kuv yuav hu kuv li Key_Gen.py

Hauv Key_Gen.py Kuv yuav nkag mus:

ntshuam cryptography los ntawm cryptography.fernet ntshuam Fernet qhov tseem ceeb = Fernet.generate_key () file = qhib ('key.key', 'wb') file.write (key) file.close ()

Txuag ces nias F5 kom khiav.

Peb ua dab tsi ntawm no yog ntshuam cov qauv peb xav tau.

Tsim qhov tseem ceeb sib txawv thiab tsim tus yuam sij hauv qhov sib txawv.

Qhib ib daim ntawv hu ua 'key.key' thiab sau rau nws.

Yog tias koj qhib koj lub nplaub tshev koj tam sim no yuav muaj 2 cov ntawv.

Key_Gen.py thiab key.key

Yog tias kuv nyeem key.key cov ntaub ntawv tsim nws nyeem:

XhnytBaYzzlDKyOUfU8DM4OjcD4cYvWtolJsyAdbwLg =

Nov yog kuv tus yuam sij. Koj li yuav txawv thiab nws yuav hloov pauv txhua lub sijhawm koj ua haujlwm. Yog li yog tias koj siv koj tus yuam sij koj tsis tuaj yeem tau txais koj cov ntaub ntawv rov qab.

Yog tias koj tus password yog tus password123 thov saib cov peev txheej hauv qab no kom pom tias koj tus password tshiab muaj kev nyab xeeb dua.

Txhawm rau txheeb xyuas koj tus password muaj zog mus rau

lossis siv Tus Thawj Tswj Password.

Kauj ruam 4: Encrypting File

Tsis muaj leej twg yuav xav tau encrypt 1 cov ntaub ntawv. Tsuas yog kuv (saib intro). Feem ntau tsis yog kuv tib neeg yuav xav tau txoj hauv kev los encrypt ntau cov ntaub ntawv. Muaj txoj hauv kev yooj yim heev kom ntseeg tau qhov sib xws. Muab tag nrho koj cov ntaub ntawv tso rau hauv ZIP.

Yog tias koj tsis paub yuav ua li cas ZIP mus ntawm no yog tias koj nyob ntawm Windows:

support.microsoft.com/en-us/help/14200/win…

Yog tias koj nyob ntawm Linux Kuv poob siab heev koj tsis paub yuav ua li cas ZIP. TAR thaub qab yuav yog koj tus phooj ywg ntawm no, lossis saib yog tias koj lub distro muaj tus tswj xyuas cov ntaub ntawv.

Thaum koj tau Zip koj cov ntaub ntawv peb tam sim no tsuas yog yuav tsum txhawj xeeb txog encrypting 1 cov ntaub ntawv. Yog li cia peb qhib peb cov ntawv thiab tsim cov ntawv hu ua 'Encrypt File.py'

Sau nws nrog cov cai

los ntawm cryptography.fernet ntshuam Fernet

file = qhib ('key.key', 'rb') key = file.read () file.close () input_file = 'secret.zip' output_file = 'transfer.encrypted' nrog qhib (input_file, 'rb') raws li f: data = f.read () fernet = Fernet (key) encrypted = fernet.encrypt (cov ntaub ntawv) nrog qhib (output_file, 'wb') li f: f.write (encrypted)

Yog li dab tsi tshwm sim?

Los ntawm cryptography peb yuav import Fernet.

Peb mam li qhib peb cov ntaub ntawv key.key peb tau tsim ua ntej thiab nyeem nws rau hauv qhov program.

Tom qab ntawd peb xav tau peb cov ntaub ntawv nkag mus. Nov yog qhov sib txawv uas koj xav hloov pauv kom haum rau koj lub npe ZIP cov ntaub ntawv. Hauv kuv rooj plaub nws yog 'secret.zip'

Qhov no yuav tso tawm raws li 'hloov pauv.encrypted'

Qhib cov ntaub ntawv nkag thiab nyeem nws hauv, encrypt siv tus yuam sij, tom qab ntawv sau nws rau cov ntawv tso tawm.

Tam sim no koj li cas Encrypted cov ntaub ntawv npaj rau thauj.

Kauj ruam 5: Split USB Method

Split USB Txoj Kev
Split USB Txoj Kev

Hauv kuv thawj qhov haujlwm, cov ntaub ntawv xav tau xa mus thoob 4 USBs. Qhov no tau ua tiav los ntawm kev nqa cov ntawv tso tawm. Qhib hauv notepad thiab muab 1/4 ntawm cov ntawv mus rau txhua USB. Cov ntaub ntawv key.key tau muab tso rau ntawm USB 5 nrog rau Decrypt program.

Ntawm qhov kawg ntawm kab ntawv cov ntawv tau muab rov qab ua ke npaj rau decrypt.

Kauj ruam 6: Decrypting

Tam sim no los txog lub sijhawm coj peb cov ntaub ntawv rov qab.

Peb yuav xav tau cov ntawv tshiab cia peb hu nws 'Decrypt File.py'

Peb tseem yuav xav tau cov cai hauv qab no.

los ntawm cryptography.fernet ntshuam Fernetinput_file = 'transfer.encrypted' file = qhib ('key.key', 'rb') key = file.read () file.close () nrog qhib (input_file, 'rb') raws li f: data = f.read () fernet = Fernet (key) encrypted = fernet.decrypt (data) nrog qhib ('output.zip', 'wb') raws li f: f.write (encrypted)

Cov cai no yuav coj tuaj rau hauv peb cov ntaub ntawv hloov pauv.encrypted ua cov ntaub ntawv, key.key ua peb tus yuam sij. Nws yuav decrypt ces sau nws li output.zip

Kauj Ruam 7: Xaus

Whilst muaj ntau lwm cov kev pabcuam encryption ntawm kev ua lag luam, ntau yam uas yog pub dawb. Tsawg tsawg tus yuav tuaj yeem siv tau ntawm qhov kaw kab ke thiab paub tias nws muaj kev nyab xeeb hauv kev thauj mus los.

Hauv kuv qhov xwm txheej thaum thauj 5 USB's. USB 1 tau tso tsis raug. Kuv muaj peev xwm thauj cov ntawv 1 rov mus rau USB tshiab los thauj. Tab sis qhov no tau pab ua pov thawj lub ntsiab lus ntawm yog vim li cas nws thiaj tau txav mus raws li nws tau ua. USB 1 tau ploj lawm. Yog tias cov ntaub ntawv tsis tau muab faib muaj qhov pheej hmoo tias cov ntaub ntawv tuaj yeem raug txiav txim siab.

Yog tias koj siv tus lej no los daws koj cov ntaub ntawv Kuv xav hnov los ntawm koj hauv cov lus.

Yog tias koj tab tom ua teeb meem nrog koj cov cai kuv tau muab txhua yam hauv ZIP cov ntaub ntawv txuas nrog.

Nyob ruaj ntseg.

Pom zoo: