RSA算法 :首先, 找出三個數, p, q, r, 其中 p, q 是兩個相異的質數, r 是與 (p-1)(q-1) 互質的數...... p, q, r 這三個數便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 這個 m 一定存在, 因為 r 與 (p-1)(q-1) 互質, 用輾轉相除法就可以得到了..... 再來, 計算 n = pq....... m, n 這兩個數便是 public_key ,編碼過程是, 若資料為 a, 將其看成是一個大整數, 假設 a < n.... 如果 a >= n 的話, 就將 a 表成 s 進位 (s
標簽: person_key RSA 算法
上傳時間: 2013-12-14
上傳用戶:zhuyibin
一元稀疏多項式計算器[加法和乘法] 問題描述: 設計一元系數多項式計數器實現兩個多項式間的加法、減法。 基本要求: (1) 輸入并建立多項式 (2) 輸出多項式,輸出形式為整數序列:n,c1,e1,c2,e2……cn,en,其中n是多項式的項數,ci,ei分別為第i項的系數和指數。序列按指數降序排列。 (3) 多項式a和b相加,建立多項式a+b,輸出相加的多項式。 (4) 多項式a和b相減,建立多項式a-b,輸出相減的多項式。 用帶表頭結點的單鏈表存儲多項式。 測試數據: (1) (2x+5x8-3.1x11)+(7-5x8+11x9) (2) (6x-3-x+4.4x2-1.2x9)-(-6x-3+5.4x2+7.8x15) (3) (x+x2+x3)+0 (4) (x+x3)-(-x-x-3)
上傳時間: 2013-12-03
上傳用戶:561596
The subject which is to us propos¨¦ is as follows: calculation of the degr¨¦ d¡ ¯ inconsistance d¡ ¯ un logical program possibilist in C++. We thus work on a logical program possibilist, it be-¨¤-statement a logical program resulting from non-classique logic. The goal first of this project is of d¨¦ terminer if a logical program is consisting or not of share the calculation of sound degr¨¦ d¡ ¯ inconsistance.
標簽: brvbar calculation subject follows
上傳時間: 2013-12-18
上傳用戶:yulg
數字運算,判斷一個數是否接近素數 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上傳時間: 2015-05-21
上傳用戶:daguda
c語言版的多項式曲線擬合。 用最小二乘法進行曲線擬合. 用p-1 次多項式進行擬合,p<= 10 x,y 的第0個域x[0],y[0],沒有用,有效數據從x[1],y[1] 開始 nNodeNum,有效數據節點的個數。 b,為輸出的多項式系數,b[i] 為b[i-1]次項。b[0],沒有用。 b,有10個元素ok。
上傳時間: 2014-01-12
上傳用戶:變形金剛
EJB快速入門 1. 準備開發環境: 從www.javasoft.com上下載下列軟件: JDK1.3, J2EE1.2.1 以及他們的文檔。在WINDOWS NT下安裝。(本文中假設為D盤根目錄) 在控制面板中選擇"系統",再選擇Environment。 將下列環境變量參數設置到用戶環境中去: 1.JAVA_HOME=D:\JDK1.3 2.J2EE_HOME=D:\J2SDKEE1.2.1 3.PATH=D:\JDK1.3\BIN D:\J2SDKEE1.2.1\BIN %PATH% 4.CLASSPATH=
上傳時間: 2015-08-12
上傳用戶:sclyutian
高精度乘法基本思想和加法一樣。其基本流程如下: ①讀入被乘數s1,乘數s2 ②把s1、s2分成4位一段,轉成數值存在數組a,b中;記下a,b的長度k1,k2; ③i賦為b中的最低位; ④從b中取出第i位與a相乘,累加到另一數組c中;(注意:累加時錯開的位數應是多少位 ?) ⑤i:=i-1;檢測i值:小于k2則轉⑥,否則轉④ ⑥打印結果
上傳時間: 2015-08-16
上傳用戶:源弋弋
分數是兩個整數的比,通常表示為 (或b/a)的形式,其中b稱為分子,a稱為分母,分母不能為0。分數在計算機中以整數或浮點數(有限小數)的形式表示,大多數情況下都是近似表示,具有較大的誤差,例如 ,在計算機中用整數表示為0,用浮點數表示為0.333333。本實例就是要設計一個Fraction (分數) 類類型,該類型的對象可以像基本類型數據一樣進行運算,結果仍為分數,運算包括四則運算,關系運算,及求一元一次分式方程的解,輸入輸出要求按分數方式進行。
上傳時間: 2016-02-18
上傳用戶:zhoujunzhen
Mir2 Actor.pas if (IsFace) and (FaceIndex > -1) then begin d := aFrmMain.WFaceimg.Images[FaceIndex * 10 + (FaceFram) mod 8] /// if HorseSurface<>nil then // dSurface.Draw (dx+shiftx, dy + hpy + ShiftY-60, d.ClientRect, d, TRUE) // else if d <> nil then begin if HorseSurface <> nil then dsurface.Draw(SayX - d.Width div 2, dy + hpy + ShiftY - 60, d.ClientRect, d, True) else dsurface.Draw(SayX - d.Width div 2, dy + hpy + ShiftY - 50, d.ClientRect, d, True) end end end
標簽: FaceIndex aFrmMain WFaceimg IsFace
上傳時間: 2016-02-21
上傳用戶:ruixue198909
編程題(15_01.c) 結構 struct student { long num char name[20] int score struct student *next } 鏈表練習: (1).編寫函數struct student * creat(int n),創建一個按學號升序排列的新鏈表,每個鏈表中的結點中 的學號、成績由鍵盤輸入,一共n個節點。 (2).編寫函數void print(struct student *head),輸出鏈表,格式每行一個結點,包括學號,姓名,分數。 (3).編寫函數struct student * merge(struct student *a,struct student *b), 將已知的a,b兩個鏈表 按學號升序合并,若學號相同則保留成績高的結點。 (4).編寫函數struct student * del(struct student *a,struct student *b),從a鏈表中刪除b鏈表中有 相同學號的那些結點。 (5).編寫main函數,調用函數creat建立2個鏈表a,b,用print輸出倆個鏈表;調用函數merge升序合并2個 鏈表,并輸出結果;調用函數del實現a-b,并輸出結果。 a: 20304,xxxx,75, 20311,yyyy,89 20303,zzzz,62 20307,aaaa,87 20320,bbbb,79 b: 20302,dddd,65 20301,cccc,99 20311,yyyy,87 20323,kkkk,88 20307,aaaa,92 20322,pppp,83
上傳時間: 2016-04-13
上傳用戶:zxc23456789