PBKDF2, Java Implementation from C#
===

Trying to get a java implementation of PBKDF2, I used this as my C# version: https://github.com/shawnmclean/SimpleCrypto.net 

My code:

    import java.security.Key;
    import java.security.NoSuchAlgorithmException;
    import java.security.spec.InvalidKeySpecException;
    import java.security.spec.KeySpec;
    
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.SecretKeySpec;
    
    public class PBKDF2 {
    
    	public static void main(String[] args) {
    		try {
    			SecretKeyFactory f = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
    			KeySpec ks = new PBEKeySpec("iamtwentycharacterss".toCharArray(),"50.eGIYr3ZpxpWw67utH17s/A==".getBytes(),50,64);
    			SecretKey s = f.generateSecret(ks);
    			Key k = new SecretKeySpec(s.getEncoded(),"HmacSHA1");
    			System.out.println(new String(k.getEncoded()));
    		} catch (NoSuchAlgorithmException e) {
    			e.printStackTrace();
    		} catch (InvalidKeySpecException e) {
    			e.printStackTrace();
    		}		
    	}
    
    }

I've tried various answers on stackoverflow:

http://stackoverflow.com/questions/11418336/java-simplecrypto-class-for-encryption-decryption-producing-different-results

http://stackoverflow.com/questions/9147463/java-pbkdf2-with-hmacsha256-as-the-prf

http://stackoverflow.com/questions/2375541/password-verification-with-pbkdf2-in-java

Unfortunately the result's don't match, the result is supposed to be:
`mOs/Mw7ZRM99i/BTJ+xnmj5Pm6QlqP1vuPqrf/Qa3WwassxI1QJ447OqdoBzunbJjvrx7+bHAO1Dnj8ltS4TKA==`