728x90 반응형 복호화2 AES256/ base64 암호화 with java build.gradle dependencies { ... implementation 'org.springframework.boot:spring-boot-starter-security' } AES_Encryption.java import java.io.ByteArrayOutputStream; import java.security.SecureRandom; import java.security.spec.AlgorithmParameterSpec; import java.util.Arrays; import java.util.Base64; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec;.. 2021. 4. 2. AES256/ base64 암호화 with python 1. install pycrytpodome pip install pycryptodome 2. python class import base64 from Crypto import Random from Crypto.Cipher import AES class AES256(): def __init__(self, key): self.bs = 128 self.key = key.encode('utf-8') self.key = AES256.str_to_bytes(key) @staticmethod def str_to_bytes(data): u_type = type(b''.decode('utf8')) if isinstance(data, u_type): return data.encode('utf8') return data d.. 2020. 3. 30. 이전 1 다음 728x90