BASE64 인코딩
public String encodeBase64(String data){
StringBuffer buffer=new StringBuffer();
BASE64Decoder decoder = new BASE64Decoder();
System.out.println("received encode test: "+data);
buffer.append("수신데이터: "+ data+"<br/>");
if ( data != null ) {
byte[] decodedBytes;
try {
decodedBytes = decoder.decodeBuffer(data);
data=new String(decodedBytes);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
buffer.append("디코딩된 수신데이터: "+data+"<br/>");
} else {
buffer.append("Input data is null !! ");
}
return buffer.toString();
}
'보안 > 시큐어코딩' 카테고리의 다른 글
[시큐어코딩] XML 인젝션 테스트 (0) | 2014.05.23 |
---|---|
[시큐어코딩실습] 정규식 테스트 (0) | 2014.05.23 |
[시큐어코딩실습] ESAPI 보안 코딩 실습 (0) | 2014.05.16 |
[시큐어코딩실습] Command Injection 취약점 제거 (0) | 2014.05.14 |
DB 보안 (0) | 2014.05.11 |