Here you can find the source of getKey(String siteSecret)
private static SecretKeySpec getKey(String siteSecret)
//package com.java2s; /*// ww w .j av a 2s. c o m * Copyright (c) 2002-2015, Google reCAPTCHA-java Authors * * This software is distributable under the BSD license. See the terms of the * BSD license in the documentation provided with this software. * * http://www.opensource.org/licenses/bsd-license.php */ import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import javax.crypto.spec.SecretKeySpec; public class Main { private static SecretKeySpec getKey(String siteSecret) { try { byte[] key = siteSecret.getBytes("UTF-8"); key = Arrays.copyOf(MessageDigest.getInstance("SHA") .digest(key), 16); return new SecretKeySpec(key, "AES"); } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { e.printStackTrace(); } return null; } }