简体   繁体   中英

Encrypting files in windows phone 8.1 Silverlight

I'm trying to implement file encryption in my app, which will take a filepath that has been obtained by a filepicker, encrypt that file and then sends the encrypted file to a different folder, and vice-versa for decryption.

I'm having trouble finding any examples that use files (I wish to encrypt images, and documents), they all seem to be for encrypting strings, which is not particularly helpful. I have found this , which uses ProtectedData to protect data, but I can't see how it could be applied to files.

Does anyone know of any resources that could be helpful to me?

Thanks

All the encryption/decryption algorithms work with byte arrays. In the document you link, you can see that ProtectedData also works with an byte arrays. So you need to read the file as an byte array, encrypt it and write the resulting byte array to a new file (a quick google search will show you how to do it).

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