Security & 암호화

Security 2010. 8. 23. 09:35
Java Security
http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html

Security Documentation
http://www.oracle.com/technetwork/java/index-139231.html

Java 1.5 Security Documentation
http://download.oracle.com/javase/1.5.0/docs/guide/security/index.html

Java Security Architecture Overview
http://download.oracle.com/javase/1.5.0/docs/guide/security/spec/security-spec.doc.html

Java Cryptography Architecture
http://download.oracle.com/javase/1.5.0/docs/guide/security/CryptoSpec.html
http://download.oracle.com/javase/1.4.2/docs/guide/security/jce/JCERefGuide.html

 

The JCE API covers:

  • Symmetric bulk encryption, such as DES, RC2, and IDEA
  • Symmetric stream encryption, such as RC4
  • Asymmetric encryption, such as RSA
  • Password-based encryption (PBE)
  • Key Agreement
  • Message Authentication Codes (MAC)
engine classes:
  • MessageDigest: used to calculate the message digest (hash) of specified data.

  • Signature: used to sign data and verify digital signatures.

  • KeyPairGenerator: used to generate a pair of public and private keys suitable for a specified algorithm.

  • KeyFactory: used to convert opaque cryptographic keys of type Key into key specifications (transparent representations of the underlying key material), and vice versa.

  • CertificateFactory: used to create public key certificates and Certificate Revocation Lists (CRLs).

  • KeyStore: used to create and manage a keystore.A keystore is a database of keys. Private keys in a keystore have a certificate chain associated with them, which authenticates the corresponding public key. A keystore also contains certificates from trusted entities.

  • AlgorithmParameters: used to manage the parameters for a particular algorithm, including parameter encoding and decoding.

  • AlgorithmParameterGenerator: used to generate a set of parameters suitable for a specified algorithm.

  • SecureRandom: used to generate random or pseudo-random numbers.
In the 1.4 release of the Java 2 SDK, the following new engines were added:
  • CertPathBuilder: used to build certificate chains (also known as certification paths).

  • CertPathValidator: used to validate certificate chains.

  • CertStore: used to retrieve Certificates and CRLs from a repository.


 Cryptographic Concepts

Encryption and Decryption
ncryption is the process of taking data (called cleartext) and a short string (a key), and producing data (ciphertext) meaningless to a third-party who does not know the key. Decryption is the inverse process: that of taking ciphertext and a short key string, and producing cleartext.

Password-based Encryption
Password-Based Encryption (PBE) derives an encryption key from a password. In order to make the task of getting from password to key very time-consuming for an attacker, most PBE implementations will mix in a random number, known as a salt, to create the key.

Cipher
Encryption and decryption are done using a cipher. A cipher is an object capable of carrying out encryption and decryption according to an encryption scheme (algorithm).

Key Agreement
Key agreement is a protocol by which 2 or more parties can establish the same cryptographic keys, without having to exchange any secret information.

Message Authentication Code

A Message Authentication Code (MAC) provides a way to check the integrity of information transmitted over or stored in an unreliable medium, based on a secret key. Typically, message authentication codes are used between two parties that share a secret key in order to validate information transmitted between these parties.

A MAC mechanism that is based on cryptographic hash functions is referred to as HMAC. HMAC can be used with any cryptographic hash function, e.g., MD5 or SHA-1, in combination with a secret shared key. HMAC is specified in RFC 2104.




How to Implement a Provider for the JavaTM Cryptography Architecture
http://download.oracle.com/javase/1.5.0/docs/guide/security/HowToImplAProvider.html#Introduction

 JDK 1.1 contains some implementations of digital signature algorithm, message digest algorithm, key generation algorithm.
Java 2 SDK adds five services of key factory, keystore creation and management, algorithm parameter management, algorithm parameter generation, certificate factory. And it's provider can supply random number generation (RNG) algorighm.

The SUN provider package includes:





Java Security 기술
http://www.dal.kr/chair/javadoc/dist01/javasec.html

자바 암호화
http://blog.kangwoo.kr/44

Java Security Socket Extension
http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html

Java Security Tools
http://download.oracle.com/javase/6/docs/technotes/tools/index.html#security

No more 'unable to find valid certification path to requested target'
http://blogs.sun.com/andreas/entry/no_more_unable_to_find

HTTPS - is the URL string itself secure?
http://askville.amazon.com/HTTPS-URL-string-secure/AnswerViewer.do?requestId=773506

JSSE
   SSL : Secure Socket Layer
   TLS : Transport Layer Security
   JSSE provide :
      data encryption
      server authentication
      message integrity
      optional client authentication
   integrated with JDK1.4
   The JSSE api can supports SSL 2.0/3.0 and TLS 1.0
   The JSSE impl of SUN supports SSL 3.0 and TLS 1.0
   JCA : Java Cryptography Architecture
   JAAS : Java Authentication and Authorization Service
   PKI : Public Key Infrastructure
   SunJSSE Provider
   DES : Data Encryption Standard

 

Secure Sockets Layer Documentation

Online resources:



Gmail - configuring other mail clients
http://mail.google.com/support/bin/answer.py?hl=en&answer=13287

Incoming Mail (POP3) Server - requires SSL: pop.gmail.com
Use SSL: Yes
Port: 995
Outgoing Mail (SMTP) Server - requires TLS or SSL: smtp.gmail.com (use authentication)
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465
Account Name: your full email address (including @gmail.com or @your_domain.com)
Email Address: your email address (username@gmail.com or username@your_domain.com)
Password: your Gmail password


keytool
http://download.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html


 -list
# keytool -list -keystore ${keystore.file}
keytool -list -keystore jssecacerts

-export
# keytool -export -alias ${alias} -keystore ${keystore.file} -file ${file}
keytool -export -alias smtp.gmail.com-1 -keystore jssecacerts.gmail -file smtp.gmail.com-1.cer

-import
# keytool -import -trustcacerts -file ${file} -keystore ${keystore.file}
keytool -import -trustcacerts -file ./smtp.gmail.com-1.cer -keystore ./jssecacerts



PKI (Public Key Infrastructure)
http://en.wikipedia.org/wiki/Public_key_infrastructure

X.509
http://en.wikipedia.org/wiki/X.509

Internet X.509 Public Key Infrastructure Certificate and CRL Profile
http://www.ietf.org/rfc/rfc2459.txt

Posted by 天下太平
,

[link] logging

Java 2010. 6. 21. 14:56
Log4J 1.2 Manual
http://logging.apache.org/log4j/1.2/manual.html

Log4j delivers control over logging
http://www.javaworld.com/jw-11-2000/jw-1122-log4j.html

log4j wiki
http://wiki.apache.org/logging-log4j/

[book] The complete log4j manual
https://www.qos.ch/shop/products/eclm/

Simple Logging Facade for Java
http://www.slf4j.org/

JBoss separating application logs
http://community.jboss.org/wiki/SeparatingApplicationLogs


Log4J

components : Logger Appender Layout
Logger = Category (before version 1.2)
Logger name : "com.foo" is parent of "com.foo.bar"
Root Logger
Level : trace, debug, info, warn, error, fatal
Level Inheritance
The inherited level for a given logger C, is equal to the first non-null level in the logger hierarchy, starting at C and proceeding upwards in the hierarchy towards the root logger.

 
Basic Selection Rule
A log request of level p in a logger with (either assigned or inherited, whichever is appropriate) level q, is enabled if p >= q.


Appenders and Layouts

an output destination is called an appender.
Currently, appenders exist for the console, files, GUI components, remote socket servers, JMS, NT Event Loggers, and remote UNIX Syslog daemons.
Each enabled logging request for a given logger will be forwarded to all the appenders in that logger as well as the appenders higher in the hierarchy

 
Appender Additivity
The output of a log statement of logger C will go to all the appenders in C and its ancestors. This is the meaning of the term "appender additivity".

However, if an ancestor of logger C, say P, has the additivity flag set to false, then C's output will be directed to all the appenders in C and its ancestors upto and including P but not the appenders in any of the ancestors of P.

Loggers have their additivity flag set to true by default.





Posted by 天下太平
,

[link] java performance tip

Java 2010. 1. 27. 15:12

Performance tips for the Java final keyword
http://www.javaperformancetuning.com/tips/final.shtml#REF1

Posted by 天下太平
,

[link] download archives

기타 2010. 1. 11. 14:10
Posted by 天下太平
,
Posted by 天下太平
,
Posted by 天下太平
,

AIX
iconv -f UTF-8 -t IBM-eucKR < a.sql > b.sql

HP-UX
iconv -f utf8 -t eucKR < a.sql > b.sql

Solaris
iconv -f UTF-8 -t EUC-KR < a.sql > b.sql

linux
iconv -f UTF-8 -t EUC-KR < a.sql > b.sql

Posted by 天下太平
,

about Collection

Java 2009. 11. 18. 23:28

List : sequence, dup elements.
        methods: get(i), contains, indexOf
ArrayList : capocity of array, fast random access
  size, isEmpty, get, set, iterator, listIterator - constant time
  add  - amortized constant time, O(n) time
  other - linear time
  lower constant factor than LinkedList
LinkedList :stack, queue, deque, slow random access, fast insert and delete, memory pointer

- ArrayList vs LinkedList
http://narencoolgeek.blogspot.com/2006/09/arraylist-vs-linkedlist.html

- Selecting Your Collections Library


Posted by 天下太平
,


vi에서 붙여넣기 할 때 필요한 옵션

:set noai
:set nosm

Posted by 天下太平
,
Posted by 天下太平
,
Posted by 天下太平
,

[link] h2 database

DB 2009. 9. 21. 02:10
Posted by 天下太平
,
Posted by 天下太平
,
http://www.ihelpers.co.kr/programming/tipntech.php?CMD=view&TYPE=0&KEY=&SC=S&&CC=&PAGE=7&IDX=409

 

리눅스

cat /proc/cpuinfo|grep processor|wc -l

솔라리스

psrinfo -v|grep "Status of processor"|wc -l

IBM-AIX

lsdev -C|grep Process|wc –l

HP/UX

ioscan -C processor | grep processor | wc -l

Posted by 天下太平
,

[link] CLOSE_WAIT

Network 2009. 7. 2. 20:55
Posted by 天下太平
,