Programming Language/Python (2) 썸네일형 리스트형 SEED 암호화 - KISA 설명 KISA에서 SEED 암호화 소스코드를 제공하지만 오래전에 작성되었던 탓인지 python으로 된 파일이 없었다. 그래서 검색으로 여러 사이트를 참고해 암호화 클래스를 작성했다. SEED 암호화란? SEED는 128 bit의 대칭키를 이용하여 임의의 길이를 갖는 입력 메시지를 블록단위로 처리하는 128 bit 블록암호 알고리즘이다. - 대칭키 암호화 => 암호화 키와 복호화 키가 같은 암호 방식 - 128bit = 16 byte bit | byte | hex bit 컴퓨터에서 사용되는 가장 작은 데이터 단위 2진수로 0과 1을 가질 수 있다. byte 8 bits으로 구성된다 (즉, 8 bits = 1 byte) bits으로 이루어진 byte array는 2진수로 이루어진 데이터이지만 사람이 읽기 어려워 .. SEED 암호화 코드 - KISA 암호화 클래스 from cryptography.hazmat.backends.openssl.backend import backend from cryptography.hazmat.primitives.ciphers import algorithms, base, modes import base64 class SEED128: def encrypt(self, key, txt): key_bytes = self.convert_key_to_byte_array(key) padded_txt_bytes = self.convert_txt_to_padded_byte_array(txt) encrypted_txt_bytes = self.seed_encrypt(key_bytes, padded_txt_bytes) b64_encrypted.. 이전 1 다음