SHA-2を用いたメッセージダイジェスト出力

 ※v8.0からサポートされました。

新しい暗号化及びメッセージダイジェストのアルゴリズムとして、AESとSHA-2(SHA-224/SHA-256/SHA-384/SHA-512)が使用できるようになりました。

{curl 8.0 applet}
{curl-file-attributes character-encoding = “shift-jis”}

{import * from CURL.CRYPTO.MSG-DIGEST}

{let dg224:SHA-224-Digester = {new SHA-224-Digester}}
{let dg256:SHA-256-Digester = {new SHA-256-Digester}}
{let dg384:SHA-384-Digester = {new SHA-384-Digester}}
{let dg512:SHA-512-Digester = {new SHA-512-Digester}}

{let vb:VBox = {VBox}}
{let txt:TextField = {TextField value = “input”} }
{let cbx:ComboBox = {ComboBox
                        value = “SHA-224-Digester”,
                        “SHA-224-Digester”,
                        “SHA-256-Digester”,
                        “SHA-384-Digester”,
                        “SHA-512-Digester”
                    }
}

{let cb:CommandButton = {CommandButton
                            label = “execute”,
                            {on Action do
                                {if cbx.value == “SHA-224-Digester” then
                                    {vb.add {dg224.digest-from-string txt.value}  }
                                 elseif cbx.value == “SHA-256-Digester” then
                                    {vb.add {dg256.digest-from-string txt.value}  }
                                 elseif cbx.value == “SHA-384-Digester” then
                                    {vb.add {dg384.digest-from-string txt.value}  }
                                 elseif cbx.value == “SHA-512-Digester” then
                                    {vb.add {dg512.digest-from-string txt.value}  }
                                 else
                                    {vb.add “miss”}
                                }
                            }
                        }
}

{value
    {vb.add cbx}
    {vb.add {HBox txt ,cb}}

    vb
}

 


SHA-2を用いたメッセージダイジェスト出力 サンプル: http://developers.curlap.com/curl/v8/digester.curl

 


 

共通鍵暗号方式 (AES)についてはこちらを参照してください。

 http://developers.curlap.com/re-reference/34-security/119-encrypt.html