2013-02-15 61 views
2

我正在爲F5 Big-IP v。11.x編寫和iRule。我有一個CRYPTO圖書館的問題。F5 BIG-IP中的CRYPTO庫問題:缺少必需的參數

當我嘗試以這種方式

set foo [CRYPTO::decrypt -alg rc4 -keyhex $key $to_decrypt] 

其中$關鍵是十六進制格式和$ to_decrypt一個字符串解密字符串加密的字符串。

我收到一個錯誤:

tmm err tmm[7107]: 01220001:3: TCL error: /Common/testirule - Missing required parameter

在這裏您可以找到的文檔:https://devcentral.f5.com/wiki/iRules.CRYPTO__decrypt.ashx

我不明白哪個參數丟失,你能幫幫我嗎?提前致謝!

編輯:我這裏補充從文檔片段:

CRYPTO::decrypt [-alg <>] [-ctx <> [-final]] [-key[hex] <>] [-iv[hex] <>] []

decrypts data based on several parameters

alg - algorithm. ASCII string from a given list (see below) The spelling is lowercase and the iRule will fail for anything not in the list. In ctx mode, alg must be given in the first CRYPTO::command and cannot be modified. ctx - context is the name of a Tcl variable and can only be generated from and used in CRYPTO commands. Notes: Trying to get or set value for a ctx variable will fail. When a CTX variable is first used in iRule, a tcl object will be generated from the given arguments (alg, key, iv, etc.). A given CTX variable can only be used for one CRYPTO:: command. An iRule CRYPTO:: command would fail if CTX is reused for different purpose. 「–final」 must be used for the last CRYPTO:: command for the same CTX variable to finish the CRYPTO:: command. After 「-final」 is used, the CTX variable will be freed and the same ctx variable name can be reused. When a CTX variable already has a key and an IV value stored in it, the value can only be updated before CRYPTO command really starts, that is before any data is given. After the command starts and before it finishes, updating key or IV in CTX would fail. key - key (binary data). Key length is determined by alg used. Can be generated by CRYPTO::keygen keyhex - key as hex data. Key length is determined by alg used. Can be generated by CRYPTO::keygen iv - initialization vector (binary data). Length is determined by alg used. Can be generated by CRYPTO::keygen ivhex - initialization vector as hex data. Length is determined by alg used. Can be generated by CRYPTO::keygen

+0

該網站需要登錄... – 2013-02-15 14:48:06

+0

我知道,不幸我無法提供訪問:(我會添加一些東西從文檔 – rikpg 2013-02-15 15:07:44

+0

問題我想知道rc4算法是否需要額外的部分(即額外的「可選」參數如'-ctx'或'-iv')。不知道確定。 – 2013-02-18 12:27:42

回答

1

-iv是可選的,因爲你可能會創建一個包含初始化向量的上下文,並通過在與-ctx代替。 TCL命令文檔沒有很好的方式說明這種情況:需要-iv-key或需要-ctx

相關問題