自己仿照MSDN上乙個簡單的C RSA加解密程式

2021-04-26 06:23:28 字數 806 閱讀 7001

**挺簡單的,首先建立rsa加密例項,然後匯入程式隨機產生的公鑰加密,解密時,exportparameters使用true則公私鑰一起匯入了。其中牽涉到一些編碼轉換,這個還沒研究過,按你需要的編碼輸出吧!

unicodeencoding byteconverter =

new unicodeencoding();

byte datatoencrypt = byteconverter.getbytes(

"data to encrypt");

byte encrypteddata;

byte decrypteddata;

rsacryptoserviceprovider rsa =

new rsacryptoserviceprovider();

rsa.exportparameters(

false);

encrypteddata = rsa.encrypt(datatoencrypt,

false);

console.writeline(

"encrypted plaintext: ", byteconverter.getstring(encrypteddata));

rsa.exportparameters(

true);

decrypteddata = rsa.decrypt(encrypteddata,

false);

console.writeline(

"decrypted plaintext:", byteconverter.getstring(decrypteddata));

自己實現乙個簡單的ArrayList

自己簡單的實現arraylist的 註解很清楚了,寫了arraylist的add obj 方法 remove index 方法,get index 方法,自己定義迭代器,自己進行迭代 迭代器介面 public inte ce iterator集合 的實現 version description 自己...

自己實現乙個簡單的hashmap

這個hashmap實現方式應該是jdk1.7的,在資料量小的時候和jdk1.8實現的差不多,不過我這個沒有採用鍊錶長度8時轉化紅黑樹增加查詢效率,在擴容時也是全部元素重新hash,計算新的位置,所以如果大資料量的時候,複製到新的陣列就會比較慢.jdk8裡面對複製到新的陣列也是有優化的,我這裡就沒做了...

關於上乙個問題的解釋

private functioninit void private function init voidtypeerror error 1034 強制轉換型別失敗 無法將 flash.display sprite 156b7b1 轉換為 mx.core.iuicomponent。而是在contain...