計算機類 外文文獻 翻譯_第1頁
計算機類 外文文獻 翻譯_第2頁
計算機類 外文文獻 翻譯_第3頁
計算機類 外文文獻 翻譯_第4頁
計算機類 外文文獻 翻譯_第5頁
已閱讀5頁,還剩10頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、 本科畢業(yè)論文外文文獻及譯文 文獻、資料題目:Core Java V olume II Advanced文獻、資料來源:著作院 (部 :計算機科學與技術(shù)學院專 業(yè):網(wǎng)絡(luò)工程班 級:網(wǎng)絡(luò) 082姓 名:劉治華學 號:2008111242指導教師:許麗娜翻譯日期:2012. 5. 10外文文獻:Core Java Volume II Advanced FeaturesWhen Java technology first appeared on the scene, the excitement was not about a well-crafted programming language bu

2、t about the possibility of safely executing applets that are delivered over the Internet (see V olume I, Chapter 10 for more information about applets. Obviously, delivering executable applets is practical only when the recipients are sure that the code can't wreak havoc on their machines. For t

3、his reason, security was and is a major concern of both the designers and the users of Java technology. This means that unlike other languages and systems, where security was implemented as an afterthought or a reaction to break-ins, security mechanisms are an integral part of Java technology.Three

4、mechanisms help ensure safety: Language design features (bounds checking on arrays, no unchecked type conversions, no pointer arithmetic, and so on. An access control mechanism that controls what the code can do (such as file access, network access, and so on. Code signing, whereby code authors can

5、use standard cryptographic algorithms to authenticate Java code. Then, the users of the code can determine exactly who created the code and whether the code has been altered after it was signed.Below, you'll see the cryptographic algorithms supplied in the java.security package, which allow for

6、code signing and user authentication.As we said earlier, applets were what started the craze over the Java platform. In practice, people discovered that although they could write animated applets like the famous "nervous text" applet, applets could not do a whole lot of useful stuff in the

7、 JDK 1.0 security model. For example, because applets under JDK 1.0 were so closely supervised, they couldn't do much good on a corporate intranet, even though relatively little risk attaches to executing an applet from your company's secure intranet. It quickly became clear to Sun that for

8、applets to become truly useful, it was important for users to be able to assign different levels of security, depending on where the applet originated. If an applet comes from a trusted supplier and it has not been tampered with, the user of that applet can then decide whether to give the applet mor

9、e privileges.To give more trust to an applet, we need to know two things: Where did the applet come from? Was the code corrupted in transit?In the past 50 years, mathematicians and computer scientists have developed sophisticated algorithms for ensuring the integrity of data and for electronic signa

10、tures. The java.security package contains implementations of many of these algorithms. Fortunately, you don't need to understand the underlying mathematics to use the algorithms in the java.security package. In the next sections, we show you how message digests can detect changes in data files a

11、nd how digital signatures can prove the identity of the signer.A message digest is a digital fingerprint of a block of data. For example, the so-called SHA1 (secure hash algorithm #1 condenses any data block, no matter how long, into a sequence of 160 bits (20 bytes. As with real fingerprints, one h

12、opes that no two messages have the same SHA1 fingerprint. Of course, that cannot be true there are only 2160 SHA1 fingerprints, so there must be some messages with the same fingerprint. But 2160is so large that the probability of duplication occurring is negligible. How negligible? According to Jame

13、s Walsh in True Odds: How Risks Affect Your Everyday Life (Merritt Publishing 1996, the chance that you will die from being struck by lightning is about one in 30,000. Now, think of nine other people, for example, your nine least favorite managers or professors. The chance that you and all of them w

14、ill die from lightning strikes is higher than that of a forged message having the same SHA1 fingerprint as the original. (Of course, more than ten people, none of whom you are likely to know, will die from lightning strikes. However, we are talking about the far slimmer chance that your particular c

15、hoice of people will be wiped out.A message digest has two essential properties: If one bit or several bits of the data are changed, then the message digest also changes. A forger who is in possession of a given message cannot construct a fake message that has the same message digest as the original

16、.The second property is again a matter of probabilities, of course. Consider the following message by the billionaire father:"Upon my death, my property shall be divided equally among my children; however, my son George shall receive nothing."That message has an SHA1 fingerprint of2D 8B 35

17、 F3 BF 49 CD B1 94 04 E0 66 21 2B 5E 57 70 49 E1 7EThe distrustful father has deposited the message with one attorney and the fingerprint with another. Now, suppose George can bribe the lawyer holding the message. He wants to change the message so that Bill gets nothing. Of course, that changes the

18、fingerprint to a completely different bit pattern:2A 33 0B 4B B3 FE CC 1C 9D 5C 01 A7 09 51 0B 49 AC 8F 98 92Can George find some other wording that matches the fingerprint? If he had been the proud owner of a billion computers from the time the Earth was formed, each computing a million messages a

19、second, he would not yet have found a message he could substitute.The Java programming language implements both SHA1 and MD5. The MessageDigest class is a factory for creating objects that encapsulate the fingerprinting algorithms. It has a static method, called getInstance, that returns an object o

20、f a class that extends the MessageDigest class. This means the MessageDigest class serves double duty: As a factory class As the superclass for all message digest algorithmsFor example, here is how you obtain an object that can compute SHA fingerprints:MessageDigest alg = MessageDigest.getInstance(&

21、quot;SHA-1"(To get an object that can compute MD5, use the string "MD5" as the argument to getInstance.After you have obtained a MessageDigest object, you feed it all the bytes in the message by repeatedly calling the update method. For example, the following code passes all bytes in

22、a file to the alg object just created to do the fingerprinting:InputStream in = . . .int ch;while (ch = in.read( != -1alg.update(byte ch;Alternatively, if you have the bytes in an array, you can update the entire array at once: byte bytes = . . .;alg.update(bytes;When you are done, call the digest m

23、ethod. This method pads the input as required by the fingerprinting algorithm does the computation, and returns the digest as an array of bytes. byte hash = alg.digest(;The program in Listing 9-15 computes a message digest, using either SHA or MD5. You can load the data to be digested from a file, o

24、r you can type a message in the text area.Message SigningIn the last section, you saw how to compute a message digest, a fingerprint for the original message. If the message is altered, then the fingerprint of the altered message will not match the fingerprint of the original. If the message and its

25、 fingerprint are delivered separately, then the recipient can check whether the message has been tampered with. However, if both the message and the fingerprint were intercepted, it is an easy matter to modify the message and then recompute the fingerprint. After all, the message digest algorithms a

26、re publicly known, and they don't require secret keys. In that case, the recipient of the forged message and the recomputed fingerprint would never know that the message has been altered. Digital signatures solve this problem.The keys are quite long and complex. For example, here is a matching p

27、air of public andprivate Digital Signature Algorithm (DSA keys.Public key:Code View:p:fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3ae1617ae01f35b91a47e6df 63413c5e12ed0899bcd132acd50d99151bdc43ee737592e17q: 962eddcc369cba8ebb260ee6b6a126d9346e38c5g:678471b27a9cf44ee91a49c5147db1a9aaf244f0

28、5a434d6486931d2d14271b9e35030b71fd7 3da179069b32e2935630e1c2062354d0da20a6c416e50be794ca4y:c0b6e67b4ac098eb1a32c5f8c4c1f0e7e6fb9d832532e27d0bdab9ca2d2a8123ce5a8018b8161 a760480fadd040b927281ddb22cb9bc4df596d7de4d1b977d50Private key:Code View:p:fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3

29、ae1617ae01f35b91a47e6df 63413c5e12ed0899bcd132acd50d99151bdc43ee737592e17q: 962eddcc369cba8ebb260ee6b6a126d9346e38c5g:678471b27a9cf44ee91a49c5147db1a9aaf244f05a434d6486931d2d14271b9e35030b71fd73 da179069b32e2935630e1c2062354d0da20a6c416e50be794ca4x: 146c09f881656cc6c51f27ea6c3a91b85ed1d70aIt is beli

30、eved to be practically impossible to compute one key from the other. That is, even though everyone knows your public key, they can't compute your private key in your lifetime, no matter how many computing resources they have available.It might seem difficult to believe that nobody can compute th

31、e private key from the public keys, but nobody has ever found an algorithm to do this for the encryption algorithms that are in common use today. If the keys are sufficiently long, brute force simply trying all possible keys would require more computers than can be built from all the atoms in the so

32、lar system, crunching away for thousands of years. Of course, it is possible that someone could come up withalgorithms for computing keys that are much more clever than brute force. For example, the RSA algorithm (the encryption algorithm invented by Rivest, Shamir, and Adleman depends on the diffic

33、ulty of factoring large numbers. For the last 20 years, many of the best mathematicians have tried to come up with good factoring algorithms, but so far with no success. For that reason, most cryptographers believe that keys with a "modulus" of 2,000 bits or more are currently completely s

34、afe from any attack. DSA is believed to be similarly secure.Figure 9-12 illustrates how the process works in practice.Suppose Alice wants to send Bob a message, and Bob wants to know this message came from Alice and not an impostor. Alice writes the message and then signs the message digest with her

35、 private key. Bob gets a copy of her public key. Bob then applies the public key to verify the signature. If the verification passes, then Bob can be assured of two facts: The original message has not been altered. The message was signed by Alice, the holder of the private key that matches the publi

36、c key that Bob used for verification.You can see why security for private keys is all-important. If someone steals Alice's private key or if a government can require her to turn it over, then she is in trouble. The thief or a government agent can impersonate her by sending messages, money transf

37、er instructions, and so on, that others will believe came from Alice.The X.509 Certificate FormatTo take advantage of public key cryptography, the public keys must be distributed. One of the most common distribution formats is called X.509. Certificates in the X.509 format are widely used by VeriSig

38、n, Microsoft, Netscape, and many other companies, for signing e-mail messages, authenticating program code, and certifying many other kinds of data. The X.509 standard is part of the X.500 series of recommendations for a directory service by the international telephone standards body, the CCITT.The

39、precise structure of X.509 certificates is described in a formal notation, called "abstract syntax notation #1" or ASN.1. Figure 9-13 shows the ASN.1 definition of version 3 of the X.509 format. The exact syntax is not important for us, but, as you can see, ASN.1 gives a precise definition

40、 of the structure of a certificate file. The basic encoding rules, or BER, and a variation, called distinguished encoding rules (DER describe precisely how to save this structure in abinary file. That is, BER and DER describe how to encode integers, character strings, bit strings, and constructs suc

41、h as SEQUENCE, CHOICE, and OPTIONAL.中文譯文:Java 核心技術(shù) 卷高級特性當 Java 技術(shù)剛剛問世時,令人激動的并不是因為它是一個設(shè)計完美的編程語言,而 是因為它能夠安全地運行通過因特網(wǎng)傳播的各種 applet 。 很顯然, 只有當用戶確信 applet 的代碼不會破壞他的計算機時, 用戶才會接受在網(wǎng)上傳播的可執(zhí)行的 applet 。 正因為如此, 無論過去還是現(xiàn)在, 安全都是設(shè)計人員和 Java 技術(shù)使用者所關(guān)心的一個重大問題。 這就意 味著, Java 技術(shù)與其他的語言和系統(tǒng)有所不同,在那些語言和系統(tǒng)中安全是事后才想到要 去實現(xiàn)的,或者僅僅是對破壞的

42、一種應(yīng)對措施,而對 Java 技術(shù)來說,安全機制是一個不可 分割的組成部分。Java 技術(shù)提供了以下三種確保安全的機制:(1語言設(shè)計特性(對數(shù)組的邊界進行檢查,無不檢查類型的轉(zhuǎn)換,無指針算法等 。(2訪問控制機制,用于控制代碼能夠執(zhí)行的功能(比如文件訪問,網(wǎng)絡(luò)訪問等 。(3 代碼簽名,利用該特性,代碼的作者就能夠用標準的加密算法來表明 Java 代碼 的身份。這樣,該代碼的使用者就能夠準確地知道誰創(chuàng)建了該代碼,以及代碼被標識后是 否被修改過。下面,我們要介紹 java.security 包提供的加密算法,用來進行代碼的標識和用戶身 份認證。正如我們前面所說, applet 是在 Java 平臺

43、上開始流行起來的。實際上,人們發(fā)現(xiàn)盡 管他們可以編寫像著名的“ nervous text”那樣栩栩如生的 applet ,但是在 JDK1.0安全 模式下無法發(fā)揮其一整套非常有用的作用。例如,由于 JDK1.0下的 applet 要受到嚴密的 監(jiān)督,因此,即使 applet 在公司安全內(nèi)部網(wǎng)上運行時的風險相對較小, applet 也無法在 企業(yè)內(nèi)部網(wǎng)上發(fā)揮很大的作用。 Sun 公司很快就認識到,要使 applet 真正變得非常有用, 用戶必須可以根據(jù) applet 的來源為其分配不同的安全級別。如果 applet 來自值得信賴的 提供商,并且沒有被篡改過,那么 applet 的用戶就可以決定是

44、否給 applet 授予更多的運 行特權(quán)。如果要給予 applet 更多的信賴,你必須知道下面兩件事:(1applet來自哪里?(2在傳輸過程中代碼是否被破壞?在過去的 50年里,數(shù)學家和技術(shù)機科學家已經(jīng)開發(fā)出各種各樣成熟的算法,用于確 保數(shù)據(jù)和電子簽名的完整性,在 java.security 包中包含了許多這些算法的實現(xiàn)。在下面 幾節(jié),我們將要介紹消息摘要是如何檢測數(shù)據(jù)文件中的變化的,以及數(shù)字簽名是如何證明 簽名者的身份的。消息摘要是數(shù)據(jù)塊的數(shù)字指紋。例如,所謂的 SHA1(安全散列算法 #1可將任何數(shù)據(jù) 塊,無論其數(shù)據(jù)有多長,都壓縮為 160位(20字節(jié)的序列。與真實的指紋一樣,人們希 望

45、任何兩條消息都不會有相同的 SHA1指紋。當然這是不可能的因為只存在 2160 個 SHA1指紋,所有肯定會有某些消息具有相同的指紋。因為 2160是一個很大的數(shù)字,所以存在重 復(fù)指紋的可能性微乎其微, 那么這種重復(fù)的可能性到底小到什么程度呢?根據(jù) James Walsh 在他的 True Odds:How Risks Affect Your Everyday Life ,Merritt Publishing出版 社 1996年出版,一書中所闡述的,你和他們所有的人都死于雷擊的概率,比偽造的消息與 原來消息具有相同的 SHA1指紋的概率還要高。 (當然, 可能有你不認識的其他 10個以上的 人

46、會死于雷擊,但這里我們討論的是你選擇的特定的人的死亡概率 。消息摘要具有兩個基本屬性:(1如果數(shù)據(jù)的 1位或者幾位改變了,那么消息摘要也將改變。(2擁有給定消息的偽造者不能創(chuàng)建與原消息具有相同摘要的假消息。當然, 第二個屬性又是一個概率問題。 讓我們來看看下面這位億萬富翁下的遺囑:“我 死了之后,我的財產(chǎn)將由我的孩子平分,但是,我的兒子 George 應(yīng)該拿不到一個子。 ” 這份遺囑的 SHA1指紋為:2D 8B 35 F3 BF 49 CD B1 94 04 E0 66 21 2B 5E 57 70 49 E1 7E這位有疑心病的父親將這份遺囑交給一位律師保存,而將指紋交給另一位律師保存。

47、現(xiàn)在,假設(shè) George 能夠賄賂那位保存遺囑的律師,他想修改這份遺囑,使得 Bill 一無所 得。當然,這需要將原指紋改為下面這樣完全不同的位模式:2A 33 0B 4B B3 FE CC 1C 9D 5C 01 A7 09 51 0B 49 AC 8F 98 92那么 George 能夠找到與該指紋相匹配的其他文字嗎?如果從地球形成之時, 他就很自 豪地擁有 10億臺計算機, 每臺計算機每秒鐘處理一百萬條信息, 他依然無法找到一個能夠 替換的遺囑。Java 編程語言已經(jīng)實現(xiàn)了 SHA1和 MD5。 MessageDigest 類是用于創(chuàng)建封裝了指紋算法 的對象的 “工廠” , 它的靜態(tài)方法

48、 getInstance 返回繼承了 MessageDigest 類的某個類的對 象。這意味著 MessageDigest 類能夠承擔下面的雙重職責:(1作為一個工廠類。(2作為所有消息摘要算法的超類。例如,下面是如何獲取一個能夠計算 SHA 指紋的對象的方法:MessageDigest alg = MessageDigest.getInstance(“SHA -1”;(如果要獲取計算 MD5的對象,請使用字符串“ MD5”作為 getInstance 的參數(shù)。 當你已經(jīng)獲取 MessageDigest 對象之后,通過反復(fù)調(diào)用 update 方法,將信息中的所 有字節(jié)提供給該對象。例如,下面的

49、代碼將文件中的所有字節(jié)傳給上面建立的 alg 對象, 以執(zhí)行指紋算法:InputStream in= .int ch;while(ch=in.read(!=-1alg.updat(byte ch;另外,如果這些字節(jié)存放在一個數(shù)組中,那就可以一次完成整個數(shù)組的更新:byte bytes =. . . ;alg.update(bytes;當完成上述操作后,調(diào)用 digest 方法。該方法填充輸入信息指紋算法需要的并 且進行相應(yīng)的計算,然后以字節(jié)數(shù)組的形式返回消息摘要。byte hash=alg.digest(;程序清單 9-15中的程序計算了一個消息摘要, 既可以用 SHA , 也可以使用 MD5來計算。山東建筑大學畢業(yè)論文外文文獻及譯文 fca682ce8e12caba26efccf7ll0e526db078b05edecbcd

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論