Fix bugs of AESHelper

deal with BadPaddingException
Fix some bugs

db.close() should be called after cursor will never be used.