Posts

Showing posts from December, 2019

[KOR] RSA 키 생성 방법, Rabin, ElGamal, ECC

대칭키 암호의 문제 ==> 키 배송 문제(key distribution problem) sol) 1. 키의 사전 공유에 의한 해결 (Trusted Authority 이용)        2. KDC - key distribution center에 의한 session key 전달 (대칭키 이용 전달)        3. Diffie - Hellman 키 생성에 의한 해결 (이산대수 문제로 세션키 생성)           3.1 DOS 공격 취약          3.2 man-in-the-middle attack           ==> cookie 이용한 dos 사전 확인 차단 // authentication으로 해결        4. 공개키 암호에 의한 해결  💥 공개키 암호 알고리즘(Public key encryption algorithm)   1. RSA (integer factorization problem, 소인수분해) 2. Rabin  (integer factorization problem,  소인수분해 ) 3. ELGamal (discrete logarithms problem, 이산대수) 4.DSA  (discrete logarithms problem,  이산대수 ) 5.ECC  (discrete logarithms problem,  이산대수 ) 비대칭키 암호시스템은 암복호화를 수학적 함수를 사용하므로 속도는 대칭키에 비해 무척느리다. 또한 공개키 암호가 대칭키 암호에 비해 암호해독에 있어서 더욱 안전하다고 생각하지만, 그것은 키의 길이와 암호를 깨는데 필요한 계산량에 따라 달리지기 때문에, 단지 비대칭키가 관용암호에 비해 더 강하다고 말할 근거가 전혀 없음.  RSA 인수분해 문제(Prime Factorization)해결의 높은 난이도를 이용한 가장 대표적인 공개키 암호 알고리즘. Rivest-Shamir-Adleman(RS

[EN] Symmetric Algorithm - feistel vs SPN

Image
☝ Symmetric-Key Block Cipher Designed to satisfy properties such as diffusion that hide the relationship between plaintext and ciphertext and confusions that hide the relationship between ciphertext and keys. P-box(Permutation box)  1. Straight P-box :  n=m 2. Expansion P-box :  n<m 3.Compression P-box :  n>m (n-number of input bit // m-number of output bit) (p-box is used for expansion of number of bits for many cases) (no inverse function exists) S-box(Substitution box) n=m or n<>m(inverse function could be possibly existed or not) 1. shift 2. swap 3. split 4. combine 5. exclusive-OR ☝ Product Cipher  Product cipher is combine of the components of a p-box and s-box in order to cover two properties( Diffusion + Confusion). 1. Feistel Cipher  There's two set : ant sets(working), grasshopper set(resting). Only doing XOR and take it to swap is what grasshopper set is doing, Taking ha

[EN] DES, 3DES, AES

Image
☝DES(Data Encryption Standard) 1. Purpose : data encryption standard 2. method : substitution + permutation  3. Number of Round : 16회전( for each P-box,S-box ) 4. Reason to be crack : Key is way too short 5. key size : 56bit  ==> modified structure of feistel network  Plaintext size : 64bit // key size : 56bit // round : 16 Components of DES : 2 of permutation box (Initial permutation, Final permutation) + 16 of feistel round function Each round key will be newly generated 48 bit key with Round-key generator ( with initial 56 bit cipher key ) <<How each round function works>> components of DES function 1. Expansion P-box  2. key XOR 3. 8 different S-boxs 4. Straight P-box quick explanation : input 64 bit (block) will be divided into 32 bits as L,R With Expansion permutation, 32 bit is changed into 48 bit. Then proceed Exclusice or with reformed 48 key bit. After Exclusive or, S-box is going to d

[KOR] DES, 3DES, AES

Image
☝DES(Data Encryption Standard) 1. 목적 : data encryption standard 2. 방식 : substitution + permutation  3. 라운드 : 16회전(P-box,S-box 각각 ) 4. crack 이유 : 짧은 키 5. key size : 56bit  ==> feistel network 변형 구조  Plaintext size : 64bit // key size : 56bit // round : 16 구성요소 : 2개의 permutation box (Initial permutation, Final permutation) + 16개의 feistel 라운드 함수 각 라운드 키는 라운드 키 생성기에 이해 암호키로부터 생성된 48bit 키 16개를 생성해냄 <<각 Round 살펴보기 >> DES 함수의 구성요소  1. Expansion P-box  2. key XOR 3. 8개의 S-box 4. Straight P-box 초반에 64bit 블럭이 32bit씩 나누어 L, R로 Input  Expansion permutation으로 key bit size에 맞게 48bit로 맞추어지고, XOR 이후 S-box 8개로 ( 8*6=48bit ==> 8*4=32bit ) 통과됨. 이후 다시 Straight permutation  DES의 복호화 과정은 라운드 키(K1~K16)은 역순으로 적용. DES함수 분석 1. S-BOX :  각 라운드에서 그 다음 라운드까지 혼돈을 만족하도록 설계됨.  + 비선형 함수 + 입력값의 한 비트를 바꾼다면 출력값에서는 두 비트 이상이 바뀐다.  2. P-BOX : Expansion permutation으로 확산(difusion)시킴 DES취약점

[KOR] 대칭키 암호(Symmetric-Key Algorithm) - feistel vs SPN

Image
☝ 대칭키 블록 암호(Symmetric-Key Block Cipher) 구성요소 plaintext와 ciphertext 사이의 관계를 숨겨버리는 확산(diffusion) 과 ciphertext와 key 사이의 관계를 숨기는 혼돈(confusion) 과 같은 성질을 만족시키기 위해 설계됨. P-box(Permutation box)  1. Straight P-box : 단순 n=m 2. Expansion P-box : 확장 n<m 3.Compression P-box : 축소 n>m (n-number of input bit // m-number of output bit) (보통 p-box는 치환하고 다음단계에서 비트수 확장을 위해 쓰임 ) (역함수 존재x) S-box(Substitution box) n=m or n<>m(즉, 역함수 존재할수도 안할수도 있음) (수학적 관계의 S-box) 1. shift 2. swap 3. split 4. combine 5. exclusive-OR 포함 ☝ Product Cipher 합성암호 확산(diffusion) + 혼돈(confusion) 두가지 성질을 커버하기 위해 암호의 구성요소들을 복합적으로 결합한 암호 1. Feistel Cipher  input bit를 두 집합으로 나누어 일만 하는 개미 집합, 일은 안하고 XOR 후 SWAP으로 넘겨만 주는 배짱이 집합,  하지만 다음 라운드로 넘어가면 둘의 운명은 바뀌는 형식 (암호화과정=복호화과정) DES,SEED사용 ROUND>=3 + 짝수 라운드 대칭 블록 암호 구현이 고려할 사항 Block size : 128bit 이상 Key size : 128bit number of rounds : 16회 이상 Subkey Generation Algorithm Round Fun

[KOR] 암호기법의 분류

Image
암호 기법의 분류 1) 치환 암호(Substitution cipher) vs 전치 암호(Transposition/permutation cipher) 치환암호 = 대치암호는 비트,문자,블록을 아예 다른 비트,문자,블록으로 대체 결국 PlainText의 집합과 CipherText의 집합은 같지 않다. 교환이 일대일로 이루어지지 않는다. 그에 반해  전치암호는 교환이 일대일로 이루어지며, PlainText의 위치를 여기저기 바꾸기만 한것!  즉, 재배열 2) 블록 암호(block cipher) vs 스트림 암호(stream cipher) 블록 암호 는 어느 특정 비트수의 집합을 한 번에 처리하는 암호 알고리즘을 총징한다.  이 집합을 block이라고 한다.  평문을 일정한 크기의 블록으로 잘라낸 후 ==> 암호화 알고리즘에 TOSS  일반적으로 블록의 크기는 8비트(아스키), 16비트(유니코드)에 비례!!  (스트림 암호와는 다르게 Round를 다룬다. 여기서 round는 댤걀을 스크램블할때 원래 원문인 생달걀을 얼마나 알아보기 힘들게 몇번의 round를 그리며 달걀을 풀것인가..! ) ☝block cipher의 장점 : 높은 확산, 기밀성, 해시함수 ex) DES, AES, IDEA, SEED, RC5 (RC4는 스트림)  스트림 암호 는 1비트 또는 1바이트의 데이터 흐름(stream)을 순차적으로 처리. 암호화 방식은 PlainText와 Key stream의 XOR 을 진행 후 CipherText 생성. ex) 0110 1010 - plaintext     1010 0010 - key stream  ====================      0011 0111 - ciphertext      1010 0010 - key stream =====================      0110 1010 - plaintext  ☝stre

Welcome to my Blog

Image
Welcome to my Blog where I will post about cryptography, system/Network/Application Security☝ 💥D ISCLAIMER💥  I'm going to POST MY BLOG IN ENGLISH/KOREAN  한국어/영어 두가지 모두 올리겠습니다 😃 First of all, I want to cover my background of  How I decided to do this daily post ups about these topics.  I recently graduated University and I was majoring in Industrial Engineering.  I have been interested in Data Science + Data mining skills But Lately, I was intrigued by system protection .  For those fields, I'd like to learn more about cryptography and other system security in general.  Cryptography, network / application / system security, malicious code analysis--IS WHAT YOU GUYS CAN EXPECT FROM MY BLOG.  So I wanted to share with people of what I'm learning and letting them learn by themselves too.  Main Reason I want to keep posting is to see the process of myself becoming more professionally equipped with these knowledges, LEARN and be confid