public void checkSign(String file, String encrypted_file) throws Exception {
        RandomAccessFile PGP_file = new RandomAccessFile(encrypted_file, "r");
        int len = -1;
        byte[] arr = new byte[2];

        while ((len = PGP_file.read(arr)) != -1 && (arr[0] & 0xff) != SP_TAG) {
            //System.out.println("checkSign: skip packet for SP");
            PGP_file.seek(arr[1] & 0xff);
        }

        if (len > 0) {
            PGP_file.seek(PGP_file.getFilePointer() - 2);
            SP sp = new SP(PGP_file);
            //byte[] sign = sp.signature.MPI_string;
            byte[] sign = (RSA.RSAoperation(Utilities.getHexString(sp.signature.MPI_string),
                    pub_exp, mod));
            if (sign[0] == (byte) 0x01) {
                int padding = 1;
                for (; sign[padding] != (byte) 0x00; padding++) ;
                byte[] hash = new byte[sign.length - padding - 16];
                System.arraycopy(sign, padding + 16, hash, 0, hash.length);
                System.out.println("Decrypted Hash:: " + Utilities.getHexString(hash));
                System.out.println("Hash of decrypted file:: " + Utilities.getHexString(sp.getHash(file)));
            } else
                System.out.println("Wrong padding");
        } else
            System.out.println("checkSign: can't find SP packet");
        PGP_file.close();
    }