freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

最新安全數(shù)據(jù)存儲系統(tǒng)的設(shè)計與實現(xiàn)(編輯修改稿)

2024-08-28 19:31 本頁面
 

【文章內(nèi)容簡介】 功能和操作劃分,主要分為兩大模塊:用戶模塊和存儲模塊用戶模塊:主要實現(xiàn)用戶界面,包括數(shù)據(jù)存儲界面和數(shù)據(jù)檢索界面。數(shù)據(jù)加密系統(tǒng)以及陷門生成系統(tǒng)(1)數(shù)據(jù)加密系統(tǒng):對即將存儲的數(shù)據(jù)進行加密,采用公鑰加密的方式進行加密,以確保其安全強度(2)關(guān)鍵詞加密系統(tǒng):用于對傳來的關(guān)鍵詞w進行加密,并將密文與(1)中系統(tǒng)加密形成的密文共同傳輸給存儲模塊(3)陷門生成系統(tǒng):在數(shù)據(jù)檢索時用于生成陷門,并實現(xiàn)和存儲模塊的連接,以便數(shù)據(jù)的檢索存儲模塊:主要用來實現(xiàn)對用戶模塊傳來的密文的存儲功能以及在數(shù)據(jù)檢測時對關(guān)鍵詞檢測并選擇消息的功能(1) 關(guān)鍵詞檢索系統(tǒng):其中含有關(guān)鍵詞檢索函數(shù)test,對于傳遞來的陷門函數(shù),進行關(guān)鍵詞檢索(2) 密文存儲:對于傳遞來的密文,存儲模塊將會將他寫入到硬盤里 第四章 數(shù)據(jù)安全存儲系統(tǒng)設(shè)計 系統(tǒng)初始化(1) 雙線性對結(jié)構(gòu)體 typedef struct sysparam{ pairing_t pairing。 }sysparams。(2) 公鑰對結(jié)構(gòu)體 typedef struct pubkey{ element_t g, h。 }pubkey。(3) 私鑰結(jié)構(gòu)體 typedef struct privatekey{ element_t alpha。 }privatekey。(4) PEKS密文結(jié)構(gòu)體 typedef struct PEKSCipher{ element_t c1, c2。 }PEKSCipher。(5) 陷門結(jié)構(gòu)體 typedef struct Trapdoor{ element_t t。 }Trapdoor。 PEKS系統(tǒng)初始化(1) 首先調(diào)用PCB庫中的函數(shù),形成雙線性初始化函數(shù),其中pbc_pairing_init_demo為pbc庫中的函數(shù),具體實現(xiàn)代碼如下:int pbc_pairing_init_demo(pairing_t pairing) { char *PairingInitString = type a\n q 8780710799663312522437781984754049815806883199414208211028653399266475630880222957078625179422662221423155858769582317459277713367317481324925129998224791\n h 12016012264891146079388821366740534204802954401251311822919615131047207289359704531102844802183906537786776\n r 730750818665451621361119245571504901405976559617\n exp2 159\n exp1 107\n sign1 1\n sign0 1\n。 char s[1000]。 int rv。 pbc_param_t param。 FILE *fp = stdin。 fp = fopen(, r)。 if (!fp) printf(error opening %s, )。 size_t count = fread(s, 1, 1000, fp)。 if (!count) printf(input error)。 fclose(fp)。 rv = pairing_init_set_buf(pairing, PairingInitString,strlen(PairingInitString))。 if (rv) { return rv。 } rv = pairing_is_symmetric(pairing)。 if (!rv) { return 2。 } return 0。}(2) 當(dāng)系統(tǒng)進行存儲操作時,首先系統(tǒng)會生成密鑰,調(diào)用keygen函數(shù)生成密鑰,其中pk為公鑰,sk為私鑰。其中調(diào)用了PCB庫中的函數(shù),代碼實現(xiàn)如下int keygen(sysparams *param, pubkey *pk, privatekey *sk) { element_init_G1(pkg, parampairing)。 element_init_G1(pkh, parampairing)。 element_init_Zr(skalpha, parampairing)。 element_random(pkg)。 element_random(skalpha)。 element_pow_zn(pkh, pkg, skalpha)。 return 0。} RSA加密系統(tǒng)初始化public class RSA { //創(chuàng)建密鑰對生成器,指定加密和解密算法為RSA public String[] Skey_RSA(int keylen){//輸入密鑰長度 String[] output = new String[5]。 //用來存儲密鑰的e n d p q try { KeyPairGenerator kpg = (RSA)。 (keylen)。 //指定密鑰的長度,初始化密鑰對生成器 KeyPair kp = ()。 //生成密鑰對 RSAPublicKey puk = (RSAPublicKey)()。 RSAPrivateCrtKey prk = (RSAPrivateCrtKey)()。 BigInteger e = ()。 BigInteger n = ()。 BigInteger d = ()。 BigInteger p = ()。 BigInteger q = ()。 output[0]=()。 output[1]=()。 output[2]=()。 output[3]=()。 output[4]=()。 } catch (NoSuchAlgorithmException ex) { (()).log(, null, ex)。 } return output。 } 數(shù)據(jù)存儲的實現(xiàn) 數(shù)據(jù)存儲界面在主界面點擊儲存按鈕后,程序會跳轉(zhuǎn)至數(shù)據(jù)存儲界面,在關(guān)鍵字一欄輸入關(guān)鍵字,在數(shù)據(jù)欄輸入數(shù)據(jù)完成后,點擊保存按鈕后,會實現(xiàn)事件響應(yīng),系統(tǒng)會將數(shù)據(jù)content和關(guān)鍵字keyword發(fā)送至PEKS系統(tǒng)中進行后續(xù)的操作,PEKS系統(tǒng)在接受關(guān)鍵詞和數(shù)據(jù)后會在系統(tǒng)內(nèi)進行加密操作,并返回密文cipher,系統(tǒng)會將cipher發(fā)送至存儲系統(tǒng)SaveImpl, 函數(shù)進行存儲,具體代碼實現(xiàn)如下(new ActionListener(){ public void actionPerformed(ActionEvent e) { String keyword1 = ()。 String content1 = ()。 PEKSSystem peksSys = new PEKSSystem()。 String cipher = (keyword1, content1)。 SaveImpl si = new SaveImpl(cipher)。 ()。 } } PEKS系統(tǒng)實現(xiàn)(1)生成密鑰后,對即將進行加密存儲的數(shù)據(jù)的關(guān)鍵進行PEKS加密,其中pk為公鑰,keyword為關(guān)鍵詞,keywordlen為關(guān)鍵詞長度,cipher為密文,具體實現(xiàn)代碼如下:int PEKS(sysparams *param, pubkey *pk, unsigned char *keyword, int keywordLen, PEKSCipher *cipher) //PEKS密文生成函數(shù){ element_t r, tmp1, tmp2。 element_init_G1(cipherc1,parampairing)。 element_init_GT(cipherc2,parampairing)。 element_init_Zr(r, parampairing)。 element_random(r)。 element_pow_zn(cipherc1, pkg, r)。 element_init_G1(tmp1, parampairing)。 element_from_hash(tmp1,keyword,keywordLen)。 element_init_G1(tmp2, parampairing)。 element_pow_zn(tmp2, pkh, r)。 element_pairing(cipherc2, tmp1, tmp2)。 return 0。}(2) 使用RSA加密算法對數(shù)據(jù)進行加密,具體代碼實現(xiàn)如下,content為輸入PEKS系統(tǒng)中的明文public String Enc_RSA(String content,String eStr,String nStr){ String cipher = new String()。 try { BigInteger e = new BigInteger(eStr)。 BigInteger n = new BigInteger(nStr)。 byte[] ptext = (UTF8)。 BigInteger m = new BigInteger(ptext)。 BigInteger c = (e, n)。 cipher = ()。 } catch (UnsupportedEncodingException ex) { (()).log(, null, ex)。 } return cipher。 }(3) PEKS系統(tǒng)在加密完數(shù)據(jù)和關(guān)鍵詞后會將兩個密文一起發(fā)送給存儲模塊進行存儲,存儲模塊調(diào)用IO輸出流,將密文寫入文件中實現(xiàn)存儲,具體代碼實現(xiàn)如下FileOutputStream fos = new FileOutputStream(current)。 char[] chardata = ()。 for(int a=0。a。a++){ (chardata[a])。 } 數(shù)據(jù)檢索界面當(dāng)用戶點擊了檢索按鈕后,系統(tǒng)會跳轉(zhuǎn)至檢索界面,在用戶輸入完成關(guān)鍵字后,系統(tǒng)會將關(guān)鍵字keyword發(fā)送至PEKS系統(tǒng)進行陷門函數(shù)操作,同時將輸出的關(guān)鍵詞密文keyWord_cipher送至存儲系統(tǒng)SaveImpl中的search方法,其中包含TEST(關(guān)鍵詞檢索算法),該算法會將發(fā)送來的keyWord_cipher與系統(tǒng)中的每個密文進行比對,若test返回true,則SaveImpl中的search返回輸出該數(shù)據(jù),具體代碼實現(xiàn)如下(new ActionListener(){ public void actionPerformed(ActionEvent e) { String keyWord1 = ()。 PEKSSystem peksSys = new PEKSSystem()。 String keyWord_cipher = (keyWord1)。 SaveImpl si = new SaveImpl()。 String content_result = 。 try { content_result = (keyWord_cipher)。 } catch (IOException e1) { ()。 } (content_result)。 } })。(1) 當(dāng)用戶輸入關(guān)鍵詞keyword結(jié)束后,系統(tǒng)會將keyword發(fā)送給PEKS系統(tǒng),調(diào)用其中的陷門函數(shù),生成加密后的關(guān)鍵詞密文,具體實現(xiàn)代碼如下,其中sk為私鑰,keyword為關(guān)鍵詞,keywordLen為關(guān)鍵詞長度int trapdoor(sysparams *param, privatekey *sk, unsigned char *keyword, int keywordLen, Trapdoor *tw) { element_t tmp。 element_init_G1(tmp, paramp
點擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1