RSA算法 :首先, 找出三個(gè)數(shù), p, q, r, 其中 p, q 是兩個(gè)相異的質(zhì)數(shù), r 是與 (p-1)(q-1) 互質(zhì)的數(shù)...... p, q, r 這三個(gè)數(shù)便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 這個(gè) m 一定存在, 因?yàn)?r 與 (p-1)(q-1) 互質(zhì), 用輾轉(zhuǎn)相除法就可以得到了..... 再來(lái), 計(jì)算 n = pq....... m, n 這兩個(gè)數(shù)便是 public_key ,編碼過(guò)程是, 若資料為 a, 將其看成是一個(gè)大整數(shù), 假設(shè) a < n.... 如果 a >= n 的話(huà), 就將 a 表成 s 進(jìn)位 (s
標(biāo)簽: person_key RSA 算法
上傳時(shí)間: 2013-12-14
上傳用戶(hù):zhuyibin
大整數(shù)乘法例子代碼 /* 遞歸邊界,如果是1位二進(jìn)制數(shù)與1位二進(jìn)制數(shù)相乘,則可以直接計(jì)算 */ /*累計(jì)做1位二進(jìn)制乘法運(yùn)算的次數(shù)*/ /* return (X*Y) */ /* 計(jì)算n的值 */ /* 把X和Y拆分開(kāi)來(lái),令X=A*2^(n/2)+B, 左移位運(yùn)算,mod = 1<<(n/2) */ /* 計(jì)算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */ /* 計(jì)算A*C,再向左移n位 */ /* 遞歸計(jì)算A*D */ /* 遞歸計(jì)算C*B */ /* 計(jì)算a21+a22,再向左移n/2位 */ /* 遞歸計(jì)算B*D */ /* XY=a1+a2+a3 */
上傳時(shí)間: 2015-05-19
上傳用戶(hù):gyq
數(shù)字運(yùn)算,判斷一個(gè)數(shù)是否接近素?cái)?shù) 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
上傳時(shí)間: 2015-05-21
上傳用戶(hù):daguda
LCS(最長(zhǎng)公共子序列)問(wèn)題可以簡(jiǎn)單地描述如下: 一個(gè)給定序列的子序列是在該序列中刪去若干元素后得到的序列。給定兩個(gè)序列X和Y,當(dāng)另一序列Z既是X的子序列又是Y的子序列時(shí),稱(chēng)Z是序列X和Y的公共子序列。例如,若X={A,B,C,B,D,B,A},Y={B,D,C,A,B,A},則序列{B,C,A}是X和Y的一個(gè)公共子序列,但它不是X和Y的一個(gè)最長(zhǎng)公共子序列。序列{B,C,B,A}也是X和Y的一個(gè)公共子序列,它的長(zhǎng)度為4,而且它是X和Y的一個(gè)最長(zhǎng)公共子序列,因?yàn)閄和Y沒(méi)有長(zhǎng)度大于4的公共子序列。 最長(zhǎng)公共子序列問(wèn)題就是給定兩個(gè)序列X={x1,x2,...xm}和Y={y1,y2,...yn},找出X和Y的一個(gè)最長(zhǎng)公共子序列。對(duì)于這個(gè)問(wèn)題比較容易想到的算法是窮舉,對(duì)X的所有子序列,檢查它是否也是Y的子序列,從而確定它是否為X和Y的公共子序列,并且在檢查過(guò)程中記錄最長(zhǎng)的公共子序列。X的所有子序列都檢查過(guò)后即可求出X和Y的最長(zhǎng)公共子序列。X的每個(gè)子序列相應(yīng)于下標(biāo)集{1,2,...,m}的一個(gè)子集。因此,共有2^m個(gè)不同子序列,從而窮舉搜索法需要指數(shù)時(shí)間。
上傳時(shí)間: 2015-06-09
上傳用戶(hù):氣溫達(dá)上千萬(wàn)的
光學(xué)設(shè)計(jì)軟件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.
標(biāo)簽: described aspheric surfaces Annular
上傳時(shí)間: 2014-01-08
上傳用戶(hù):yyyyyyyyyy
1 概述 1.1 編寫(xiě)目的 本文檔的編寫(xiě)目的是:詳細(xì)定義×××××軟件的總體功能;給出系統(tǒng)的結(jié)構(gòu)設(shè)計(jì),作為過(guò)程設(shè)計(jì)和程序編寫(xiě)的依據(jù)。 1.2 參考資料 包括: a. 項(xiàng)目來(lái)源; b. 本文檔中引用到的規(guī)范和資料等; c. 列出這些規(guī)范和資料的作者、編號(hào)、標(biāo)題、發(fā)表日期、出版單位或資料來(lái)源。 1.3 術(shù)語(yǔ)和縮寫(xiě)詞* 列出本文檔中用到的專(zhuān)門(mén)術(shù)語(yǔ)的定義和縮寫(xiě)詞,縮寫(xiě)詞要給出中文譯名和英文全稱(chēng),常用的不需要定義。 2 需求概述 2.1 目標(biāo)與需求 概述系統(tǒng)的特性和需求,擴(kuò)充軟件需求說(shuō)明中的信息,給出增加的細(xì)節(jié),詳盡地指出對(duì)軟件需求說(shuō)明中有關(guān)特性和需求做出的變更。 2.2 環(huán)境描述 描述運(yùn)行軟件系統(tǒng)所需的軟、硬件環(huán)境;描述開(kāi)發(fā)軟件系統(tǒng)所需的軟、硬件環(huán)境。 2.3 條件和限制 描述可能影響設(shè)計(jì)方案形成及實(shí)施的條件和限制。
上傳時(shí)間: 2013-12-18
上傳用戶(hù):stvnash
設(shè)計(jì)一個(gè)字節(jié)(8 位)比較器。 要求:比較兩個(gè)字節(jié)的大小,如a[7:0]大于 b[7:0]輸出高電平,否則輸出低電平,改寫(xiě)測(cè)試 模型,使其能進(jìn)行比較全面的測(cè)試 。
上傳時(shí)間: 2015-11-07
上傳用戶(hù):manking0408
一:需求分析 1. 問(wèn)題描述 魔王總是使用自己的一種非常精練而抽象的語(yǔ)言講話(huà),沒(méi)人能聽(tīng)懂,但他的語(yǔ)言是可逐步解釋成人能聽(tīng)懂的語(yǔ)言,因?yàn)樗恼Z(yǔ)言是由以下兩種形式的規(guī)則由人的語(yǔ)言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫(xiě)一個(gè)魔王語(yǔ)言的解釋系統(tǒng),把 他的話(huà)解釋成人能聽(tīng)得懂的話(huà). 2. 基本要求: 用下述兩條具體規(guī)則和上述規(guī)則形式(2)實(shí)現(xiàn).設(shè)大寫(xiě)字母表示魔王語(yǔ)言的詞匯 小寫(xiě)字母表示人的語(yǔ)言的詞匯 希臘字母表示可以用大寫(xiě)字母或小寫(xiě)字母代換的變量.魔王語(yǔ)言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測(cè)試數(shù)據(jù): B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫(xiě)字母與漢字建立下表所示的對(duì)應(yīng)關(guān)系,則魔王說(shuō)的話(huà)是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時(shí)間: 2014-12-02
上傳用戶(hù):jkhjkh1982
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
標(biāo)簽: converts Toolbox complex logical
上傳時(shí)間: 2016-02-12
上傳用戶(hù):a673761058
java寫(xiě)的圍棋游戲小程序 開(kāi)發(fā)思路 調(diào)用applet類(lèi)作為父類(lèi)。在init事件中調(diào)用Qipan類(lèi),作出panel,上加控制用控件。在paint事件里調(diào)用drawline函數(shù)畫(huà)棋盤(pán),注冊(cè)鼠標(biāo)動(dòng)作。鼠標(biāo)單擊位置上用drawoval畫(huà)出棋子, 事件處理過(guò)程 A。重新開(kāi)始 B。選擇尺寸 C?;谄迨录? D。前進(jìn)事件 有三個(gè)文件Weiqi.java,Qizi.java,Qipan.java
標(biāo)簽: applet Qipan java init
上傳時(shí)間: 2014-01-07
上傳用戶(hù):gyq
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1