2013-09-30 3 views

답변

1

이 방법이 효과가 있습니까?

$key = "2012" 
$string = "End of the world is nowhere near us." 
$sha256 = New-Object System.Security.Cryptography.HMACSHA256 
$sha256.key = [Text.Encoding]::ASCII.GetBytes($key) 
$signature = $sha256.ComputeHash([Text.Encoding]::ASCII.GetBytes($string)) 
$hash = ([Convert]::ToBase64String($signature)) -replace '-','' 
+0

감사합니다. 우리는 IIS에서 생성 된 것과 같은 키가 필요합니다. 그러나 생성 된 값이 문자열 형식이지만 IIS의 키 (유효성 검사 키와 암호 해독 키 모두)가 16 진수 형식 인 것 같습니다. 16 진수 값 (유효성 검사 키 및 암호 해독 키가 필요한 바이트 수)로 나를 업데이트 할 수 있습니까? – Vinoth