IT이야기/Powershell
파워쉘을 통한 비밀번호 암호화(ConvertTo-SecureString)
주현ㅇHㅂI
2015. 5. 18. 14:22
728x90
간혹 배치파일은 만들다 보면 계정의 비밀번호를 넣는 경우가 있다.
하지만 보안적인 문제가 발생 되기에 암호화를 해서 넣을 수가 있다.
Search하니 역시나 원하는 답이 있었다. ㅋㅋㅋ
1. 파워쉘을 실행한다.
"password" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString
The output is luckily not the unencrypted password we entered, it is a string containing the encrypted version of the password.
결과
01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b9fe0ca15a2ffb4a9e172d76a87afae40000000002000000000003660000c000000010000000875
eab73cc326c4acb70b609f170da6d0000000004800000a0000000100000001efe13d29355bea97995960f306c0009180000005a906fee5e408ccf685bbc56dd
1c3e3c91472d168c17d38a140000008bf9a9f060d1c46d1d96441d2080218ff0ada1a6
출처
<http://blog.coretech.dk/rja/store-encrypted-password-in-a-powershell-script/>
728x90