Encrypt uploaded file in android before saving

Is it possible to encrypt a file after uploading and before saving in internal storage in cordova android? If so how can I do it? Can anyone provide some code samples? Sorry that question is too broad, I am new to android.