-2

i want to encrypt a string to make data that is being stored secure, how would i do this. the code is found below. i am new to programming and encryption therefore need help on how to actually encrypt data that is being saved if anyone can guide please?

public class Utilities {

public static final String FILE_EXTENSION = ".bin";

public static boolean saveNote(Context context, Notes notes){
    String fileName = String.valueOf(notes.getDateTime()) + FILE_EXTENSION;

not sure if the code provided is sufficient enough to see how to add encryption to a string which is "filename". how would i be able to implement encrypt/decrypt on that?

Jay1
  • 29
  • 5
  • Have a look here: [link](http://www.code2learn.com/2011/06/encryption-and-decryption-of-data-using.html) – Jay Apr 27 '17 at 18:00
  • 2
    Possible duplicate of [How to encrypt String in Java](http://stackoverflow.com/questions/1205135/how-to-encrypt-string-in-java) – Zzrot Apr 27 '17 at 18:02

1 Answers1

-1

for simple encryption you can use base64 encoding and decoding. but if you want to high level security you can go with encryption and decryption algorithm like RC4, RC6, RSA, ECC, or AES and many more. for this you can use following java libraries :-

java.security
javax.crypto
Anshul Sharma
  • 3,432
  • 1
  • 12
  • 17