I hope this helps . The Python base 64 library returns a bytes object rather than a string when encoding (which is a bit odd since the whole point of base 64 encoding is to create a printable string). This means that when you convert the result to a string to save it in sqlite it is in the form b'XXX...XX', i.e. it is saved as a string starting with a b with quotes around the actual base64 encoded data.
Does that help I haven't read the code closely, but I assume this happens because AES only operates on blocks of 16 bytes at once. So my guess is you need to manually apply some form of reversible padding to your string before encryption so it becomes a multiple of 16, and then reverse the padding after decryption. You could also change the Cipher.getInstance() strings in the crypto code so the encryption will support padding natively, though I don't know which padding types and cipher modes are available on Android.
it helps some times Do not store credit card information in a database. It's a recipe for trouble. Doing so will make you a very attractive target for hackers and, if they are successful in retrieving them, end your business and potentially ruin your life as well as the lives of those whose credit card numbers are stolen. Also It is possible that storing such an information is illegal but depends upon the laws of you country. Please do check the guidelines.
How to decrypt an encrypted string with unknown decryption
will help you If you don't have a private key. You can't decrypt. If you don't have an encryption method and don't have a key. You super can't decrypt. There's no method to figure out what encryption was used. And even if you did know unless it was md5 (I can tell by looking it isn't) or something else super easy (not likely) then there's no perfect method for breaking into it and most of those methods involve a super computer and lots and lots of time.