简体   繁体   中英

How can I make a file to be encrypted?

If I make a program, with I want to make encrypted files, how can I make it? How can I do, that only my program can read it? I want to make the program in eclipse, for android.

Take a look at this thread: How to encrypt and decrypt file in Android?

There are several ways to perform encryption within Java (and are not necessarily unique to Android). Once you've got your file encrypted though, where will you securely store the decryption key? If it's something that must be stored (versus a passcode the user provides) then are you willing to accept that as a trivial point of attack?

The following are good research points for learning about encryption:

import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM