Comments (3)
I tried modifying the way image is saved.
- not much success.
fun decryptFile( inputFile : File ) : File {
val size = inputFile.length().toInt()
val fileBytes = ByteArray(size)
val aeS256JNCryptor = AES256JNCryptor()
val file = File(Environment.getExternalStorageDirectory().toString() + "/Decrypted_" + inputFile.name)
try {
val buf = BufferedInputStream(FileInputStream(inputFile))
buf.read(fileBytes, 0, fileBytes.size)
val decryptedFileBytes = aeS256JNCryptor.decryptData(fileBytes, "master".toCharArray())
if( file.exists() ) file.delete()
//val bufOut = BufferedOutputStream(file.outputStream())
//bufOut.write(decryptedFileBytes)
val fileOutputStream = FileOutputStream( file.absolutePath )
fileOutputStream.write(decryptedFileBytes)
buf.close()
fileOutputStream.close()
//bufOut.close()
} catch (e: FileNotFoundException) {
// TODO Auto-generated catch block
e.printStackTrace()
} catch (e: IOException) {
// TODO Auto-generated catch block
e.printStackTrace()
}
return file
}
As well as Bitmap decode :
val fileOutputStream = FileOutputStream( file.absolutePath )
//fileOutputStream.write(decryptedFileBytes)
val bitmap = BitmapFactory.decodeByteArray(decryptedFileBytes, 0, decryptedFileBytes.size)
if( bitmap != null )
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream)
buf.close()
fileOutputStream.close()
from jncryptor.
I'm not familiar with the platform you're using (which I assume is Kotlin, based on your stackoverflow question).
I think you're best to seek support through stack overflow, so I'll close this issue here. Please re-open (or open a new one) if a bug is found within this library.
from jncryptor.
@dmjones500 Yes, I have opened the question in Stack overflow too. I can convert the code into Java and post it in SO Post, Would it help?
from jncryptor.
Related Issues (20)
- Is JNCryptor under active development, or being used by others integrating with RNCryptor? HOT 4
- no main manifest attribute in jncryptor-1.2.0.jar HOT 1
- Salt (or IV) HOT 3
- Caused by: org.cryptonode.jncryptor.CryptorException: Unrecognised version number: -119. HOT 2
- Different encryption on IOS and android. HOT 1
- Is this project still maintained? HOT 2
- How to deal with AES256JNCryptorInputStream? HOT 2
- decrypt issue on Android HOT 2
- how to compile that example? HOT 1
- Unable to get the decryptData method to work correctly; can you provide an example? HOT 1
- org.cryptonode.jncryptor.CryptorException: Unrecognised version number: 83 HOT 1
- org.cryptonode.jncryptor.CryptorException: Unrecognised version number: 83 HOT 1
- Throws exception while decrypting HOT 6
- Add support for Java 9 (the jigsaw framework)
- The encryption sends an exception HOT 4
- Empty Password HOT 1
- Add Possibility to Switch Security Provider
- Did't support android studio 3.6.3
- Videos encrypted in swift RNCryptor cannot be decrypted using JNCryptor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jncryptor.