2016-06-08 10 views
0

Openssl은 FIPS 모드로 들어가고 나오는 것을 허용합니다. Windows crypto api 및 .net 래퍼 클래스도 비슷한 기능을 제공합니까?.net 응용 프로그램에서 FIPS를 잠시 사용할 수 있습니까?

FIPS 모드를 활성화하고 문서에 서명 한 다음 일반 모드로 돌아가고 싶습니다.

+0

관련 https://blogs.technet.microsoft.com/secguide/2014/04/07/why-were-not-recommending-fips-mode-anymore/ 대답이 아니지만 검색을 안내 할 수 있습니다. – Will

답변

1

불행히도 아닙니다; 최소한 건축 적 변화가없는 것은 아닙니다.

HKLM\System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy\Enabled (DWORD) 

0 몇 가지 제한이 있습니다, 하나는 그러나

을 활성화, 비활성화 :

당신은 레지스트리 값 설정/해제 FIPS 모드를 활성화 할 수 있습니다에 당신이 암호화 공급자를로드하면 당신의 프로세스의 나머지 부분 동안 FIPS 모드의 상태를 "기억"합니다.

: 그래서 이런 코드가 작동 것이다 :

static void Main(string[] args) 
{ 
    using (RegistryKey fipsAlgorithmPolicy = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy", true)) 
    { 
     fipsAlgorithmPolicy.SetValue("Enabled", 1, RegistryValueKind.DWord); 
    } 
    SHA1 sha = new SHA1Managed(); // throws, which is what you want 
} 

(주 두 경우 모두가 FIPS 모드가 시작 부분에 떨어져 있다고 가정)하지만이 같은 코드는 않을 것 :

위해
static void Main(string[] args) 
{ 
    SHA1 sha = new SHA1Managed(); // Does not throw, which is expected 
    using (RegistryKey fipsAlgorithmPolicy = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy", true)) 
    { 
     fipsAlgorithmPolicy.SetValue("Enabled", 1, RegistryValueKind.DWord); 
    } 
    sha = new SHA1Managed(); // Also does not throw, which is a shame 
} 

위해 할 새 상태를 반영하는 코드가 있으면 프로세스를 다시 시작해야합니다. 이 말을 듣고 일 수 있습니다. FIPS 모드를 설정 한 후 응용 프로그램이 생성하는 "도우미"프로세스로 암호화 루틴을 수행하는 코드를 격리합니다. 구현하는 데 약간의 어려움이 있지만 FIPS 모드를 전환하고 코드가 예상대로 작동하도록 할 수 있습니다.

+0

대단한 답변을 보내 주셔서 감사합니다. OpenSSL을 openssl-net과 함께 사용하는 것으로 끝 맺었습니다. – GenuineRex