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
Quality, object.oriented architecture is the product of careful study, decision making, and experimentation. At a minimum, the object.oriented architecture process includes farming of requirements, architecture mining, and hands.on experience. Ideally, object.oriented architecture comprises a set of high.quality design decisions that provide benefits throughout the life cycle of the system.
標簽: architecture decision oriented Quality
上傳時間: 2014-10-28
上傳用戶:love_stanford
大整數乘法例子代碼 /* 遞歸邊界,如果是1位二進制數與1位二進制數相乘,則可以直接計算 */ /*累計做1位二進制乘法運算的次數*/ /* return (X*Y) */ /* 計算n的值 */ /* 把X和Y拆分開來,令X=A*2^(n/2)+B, 左移位運算,mod = 1<<(n/2) */ /* 計算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */ /* 計算A*C,再向左移n位 */ /* 遞歸計算A*D */ /* 遞歸計算C*B */ /* 計算a21+a22,再向左移n/2位 */ /* 遞歸計算B*D */ /* XY=a1+a2+a3 */
上傳時間: 2015-05-19
上傳用戶:gyq
數字運算,判斷一個數是否接近素數 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
LCS(最長公共子序列)問題可以簡單地描述如下: 一個給定序列的子序列是在該序列中刪去若干元素后得到的序列。給定兩個序列X和Y,當另一序列Z既是X的子序列又是Y的子序列時,稱Z是序列X和Y的公共子序列。例如,若X={A,B,C,B,D,B,A},Y={B,D,C,A,B,A},則序列{B,C,A}是X和Y的一個公共子序列,但它不是X和Y的一個最長公共子序列。序列{B,C,B,A}也是X和Y的一個公共子序列,它的長度為4,而且它是X和Y的一個最長公共子序列,因為X和Y沒有長度大于4的公共子序列。 最長公共子序列問題就是給定兩個序列X={x1,x2,...xm}和Y={y1,y2,...yn},找出X和Y的一個最長公共子序列。對于這個問題比較容易想到的算法是窮舉,對X的所有子序列,檢查它是否也是Y的子序列,從而確定它是否為X和Y的公共子序列,并且在檢查過程中記錄最長的公共子序列。X的所有子序列都檢查過后即可求出X和Y的最長公共子序列。X的每個子序列相應于下標集{1,2,...,m}的一個子集。因此,共有2^m個不同子序列,從而窮舉搜索法需要指數時間。
上傳時間: 2015-06-09
上傳用戶:氣溫達上千萬的
電力系統在臺穩定計算式電力系統不正常運行方式的一種計算。它的任務是已知電力系統某一正常運行狀態和受到某種擾動,計算電力系統所有發電機能否同步運行 1運行說明: 請輸入初始功率S0,形如a+bi 請輸入無限大系統母線電壓V0 請輸入系統等值電抗矩陣B 矩陣B有以下元素組成的行矩陣 1正常運行時的系統直軸等值電抗Xd 2故障運行時的系統直軸等值電抗X d 3故障切除后的系統直軸等值電抗 請輸入慣性時間常數Tj 請輸入時段數N 請輸入哪個時段發生故障Ni 請輸入每時段間隔的時間dt
上傳時間: 2015-06-13
上傳用戶:it男一枚
this demo is to show you how to implement a generic SIR (a.k.a. particle, bootstrap, Monte Carlo) filter to estimate the hidden states of a nonlinear, non-Gaussian state space model.
標簽: a.k.a. bootstrap implement particle
上傳時間: 2014-11-10
上傳用戶:caozhizhi
光學設計軟件zemax源碼: This DLL models an nular aspheric surface as described in: "Annular surfaces in annular field systems" By Jose M. Sasian Opt. eng. 36 (12) P 3401-3401 December 1997 This surface is essentially an odd aspheric surface with an offset in the aspheric terms. The sag is given by: Z = (c*r*r) / (1+(1-((1+k)*c*c*r*r))^ 1/2 ) + a*(r-q)^2 + b*(r-q)^3 + c*(r-q)^4 + ... Note the terms a, b, c, ... have units of length to the -1, -2, -3, ... power.
標簽: described aspheric surfaces Annular
上傳時間: 2014-01-08
上傳用戶:yyyyyyyyyy
1 概述 1.1 編寫目的 本文檔的編寫目的是:詳細定義×××××軟件的總體功能;給出系統的結構設計,作為過程設計和程序編寫的依據。 1.2 參考資料 包括: a. 項目來源; b. 本文檔中引用到的規范和資料等; c. 列出這些規范和資料的作者、編號、標題、發表日期、出版單位或資料來源。 1.3 術語和縮寫詞* 列出本文檔中用到的專門術語的定義和縮寫詞,縮寫詞要給出中文譯名和英文全稱,常用的不需要定義。 2 需求概述 2.1 目標與需求 概述系統的特性和需求,擴充軟件需求說明中的信息,給出增加的細節,詳盡地指出對軟件需求說明中有關特性和需求做出的變更。 2.2 環境描述 描述運行軟件系統所需的軟、硬件環境;描述開發軟件系統所需的軟、硬件環境。 2.3 條件和限制 描述可能影響設計方案形成及實施的條件和限制。
上傳時間: 2013-12-18
上傳用戶:stvnash
/* * EULER S ALGORITHM 5.1 * * TO APPROXIMATE THE SOLUTION OF THE INITIAL VALUE PROBLEM: * Y = F(T,Y), A<=T<=B, Y(A) = ALPHA, * AT N+1 EQUALLY SPACED POINTS IN THE INTERVAL [A,B]. * * INPUT: ENDPOINTS A,B INITIAL CONDITION ALPHA INTEGER N. * * OUTPUT: APPROXIMATION W TO Y AT THE (N+1) VALUES OF T. */
標簽: APPROXIMATE ALGORITHM THE SOLUTION
上傳時間: 2015-08-20
上傳用戶:zhangliming420