This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.KeyGenerator; | |
import javax.crypto.SecretKey; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.SecretKeySpec; | |
import javax.crypto.spec.IvParameterSpec; | |
import java.security.MessageDigest; | |
import java.security.spec.AlgorithmParameterSpec; | |
import javax.xml.bind.DatatypeConverter; | |
public class AESEnDecryption { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Runtime.Serialization.Formatters.Binary; | |
class AESEnDecryption | |
{ | |
public static byte[] encrypt(byte[] bytes, string keyStr, string ivStr) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.KeyGenerator; | |
import javax.crypto.SecretKey; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.SecretKeySpec; | |
import javax.crypto.spec.IvParameterSpec; | |
import java.security.MessageDigest; | |
import java.security.spec.AlgorithmParameterSpec; | |
import android.util.Base64; | |
public class AESEnDecryption { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FWEncryptorAES.h | |
// AES Encryptor | |
// | |
// Created by FrankWu on 2013/12/20. | |
// Copyright (c) 2013年 FrankWu. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
public class Encryptor { | |
public static void main(String[] args) throws Exception{ | |
/* | |
//Sample Code | |
String msg = "this is msg"; | |
String keyStr = "this is key"; | |
String ivStr = "this is iv"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AllPassEncryptorAES.h | |
// AllPassEncryptorAES | |
// | |
// Created by FrankWu on 2013/12/22. | |
// Copyright (c) 2013年 FrankWu. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <Foundation/NSString.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================================= | |
第一題 | |
請設計一ruby程式,檔名為exf1.rb,並符合以下所有規範: | |
(1)不加參數時,產生20個1到10的亂數並印出來(一行印出所有亂數),第二行 | |
印出本次出現最多次的數字與其次數(如有同樣個數,印出任一個即可)。 | |
執行範例如下: | |
./exf1.rb | |
4 5 7 1 2 4 7 8 9 1 2 3 7 7 4 7 7 6 6 2 | |
7: 6 times | |
(2) 加一個參數時,參數為個數值,依該傳入參數產生幾個1到10的亂數, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
期中補考-另補試題目(時間2013/12/23 22:00至23:00, 1個小時) | |
請設計一ruby程式,檔名為m2.rb,並完成以下需求: | |
這是一支模擬RPG遊戲的程式,地圖為橫向6格,縱向5格,如下圖: | |
(1) 圖中的T代表陷阱,每次走到陷阱時要扣除30點HP,圖中的B代表補血站,每次走到補血站可回復50點HP(最多補到100)。 | |
(2) 每走一步會耗費5點HP,但處於邊緣再往牆走時(不能移動)不扣HP。 | |
(3) 圖中波浪位置代表河流,走進河流時,角色即死亡,不能再移動。 | |
(4) 圖中的G位置代表成功到達點,當成功到達此位置時,請印出PASSED,角色亦不能再移動。 | |
(5) 每次移動要印出角色目前的位置與HP血量,預設血量為100,若血量扣完了請直接結束程式。 | |
(6) 輸入0時,可結束程式。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FWJSONPrint.h | |
// ClassComment | |
// | |
// Created by FrankWu on 2014/2/11. | |
// Copyright (c) 2014年 FrankWu. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PCCUYYM.h | |
// ClassComment | |
// | |
// Created by FrankWu on 2014/2/17. | |
// Copyright (c) 2014年 FrankWu. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
OlderNewer