티스토리 뷰

C#

[C#] Encrypt_C#_SHA1

ACABerry 2016. 10. 4. 12:11
반응형

using System.Security.Cryptography;


while ( true )
            {
                SHA1 sha = new SHA1CryptoServiceProvider();
                string hashInput = Console.ReadLine();
                if ( hashInput == "exit " ) break;

                Console.WriteLine( "INPUT:" + hashInput );
                byte[] shaSetter = Encoding.ASCII.GetBytes(hashInput);
                byte[] res = sha.ComputeHash( shaSetter );
                //Console.WriteLine( "OUT:" + res.ToString() );

                Console.WriteLine( "Base64 Encoding : " + Convert.ToBase64String( res ) );
                Console.WriteLine( "ASCII Encoding : \n" + Encoding.ASCII.GetString( res ) );
            }



https://www.dotnetperls.com/convert-string-byte-array


http://www.hanbit.co.kr/network/category/category_view.html?cms_code=CMS5861764437


MDSN에도 잘 있어요 !

반응형

'C#' 카테고리의 다른 글

코루틴  (0) 2016.12.20
CSV to Json, JsonParser, logcat  (0) 2016.12.12
[Unity C#] 기기 로케일 가져오기  (0) 2016.12.12
[C#] SHA1 MD5 암호화 기법 간단하고 강력하게 !*  (0) 2016.10.07
[Unity C#] Unity Inspector Customize  (0) 2016.10.07
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
TAG
more
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함