Java 256-bit AES Password-Based Encryption

Share the password (a char[]) and salt (a byte[]—8 bytes selected by a SecureRandom makes a good salt—which doesn’t need to be kept secret) with the recipient out-of-band. Then to derive a good key from this information: /* Derive the key, given password and salt. */ SecretKeyFactory factory = SecretKeyFactory.getInstance(“PBKDF2WithHmacSHA256”); KeySpec spec = new PBEKeySpec(password, … Read more

What are the differences between LDAP and Active Directory?

Active Directory is a database based system that provides authentication, directory, policy, and other services in a Windows environment LDAP (Lightweight Directory Access Protocol) is an application protocol for querying and modifying items in directory service providers like Active Directory, which supports a form of LDAP. Short answer: AD is a directory services database, and … Read more

Select element based on multiple classes

You mean two classes? “Chain” the selectors (no spaces between them): .class1.class2 { /* style here */ } This selects all elements with class1 that also have class2. In your case: li.left.ui-class-selector { } Official documentation : CSS2 class selectors. As akamike points out a problem with this method in Internet Explorer 6 you might … Read more

What should be the values of GOPATH and GOROOT?

GOPATH is discussed in the cmd/go documentation: The GOPATH environment variable lists places to look for Go code. On Unix, the value is a colon-separated string. On Windows, the value is a semicolon-separated string. On Plan 9, the value is a list. GOPATH must be set to get, build and install packages outside the standard … Read more

Java: notify() vs. notifyAll() all over again

Clearly, notify wakes (any) one thread in the wait set, notifyAll wakes all threads in the waiting set. The following discussion should clear up any doubts. notifyAll should be used most of the time. If you are not sure which to use, then use notifyAll.Please see explanation that follows. Read very carefully and understand. Please … Read more

Only using @JsonIgnore during serialization, but not deserialization

Exactly how to do this depends on the version of Jackson that you’re using. This changed around version 1.9, before that, you could do this by adding @JsonIgnore to the getter. Which you’ve tried: Add @JsonIgnore on the getter method only Do this, and also add a specific @JsonProperty annotation for your JSON “password” field … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)