@@ -0,0 +1,1749 @@
+package com.roly.nfc.crypto;%0A%0Aimport java.io.UnsupportedEncodingException;%0Aimport java.security.InvalidKeyException;%0Aimport java.security.NoSuchAlgorithmException;%0A%0Aimport javax.crypto.BadPaddingException;%0Aimport javax.crypto.Cipher;%0Aimport javax.crypto.IllegalBlockSizeException;%0Aimport javax.crypto.NoSuchPaddingException;%0Aimport javax.crypto.SecretKey;%0A%0Aimport android.util.Base64;%0A%0Apublic class Encryption %7B%0A%0A    public static String encrypt(SecretKey key, String stringToEncrypt) throws BadPaddingException,%0A            IllegalBlockSizeException,%0A            UnsupportedEncodingException,%0A            NoSuchPaddingException,%0A            NoSuchAlgorithmException,%0A            InvalidKeyException %7B%0A%0A        Cipher ecipher = Cipher.getInstance(%22DES%22);%0A%0A        ecipher.init(Cipher.ENCRYPT_MODE, key);%0A%0A        // Encode the string into bytes using utf-8%0A        byte%5B%5D utf8 = stringToEncrypt.getBytes(%22UTF8%22);%0A%0A        // Encrypt%0A        byte%5B%5D enc = ecipher.doFinal(utf8);%0A        // Encode bytes to base64 to get a string%0A        return Base64.encodeToString(enc,Base64.DEFAULT);%0A%0A    %7D%0A%0A    public static String decrypt(SecretKey key, String stringToDecrypt) throws BadPaddingException,%0A            IllegalBlockSizeException,%0A            UnsupportedEncodingException,%0A            NoSuchPaddingException,%0A            NoSuchAlgorithmException,%0A            InvalidKeyException %7B%0A%0A        Cipher decipher = Cipher.getInstance(%22DES%22);%0A%0A        decipher.init(Cipher.DECRYPT_MODE, key);%0A        // Decode base64 to get bytes%0A        byte%5B%5D dec = Base64.decode(stringToDecrypt.getBytes(),Base64.DEFAULT);%0A%0A        // Decrypt%0A        byte%5B%5D utf8 = decipher.doFinal(dec);%0A%0A        // Decode using utf-8%0A        return new String(utf8, %22UTF8%22);%0A%0A    %7D%0A%7D%0A

add Encryption class