Save Encrypted data in text file - encryption

I have encrypted my output data. I want to save that data in a file. When I am saving it in a text file, I believe it is not saved properly. Because, I can't get proper data after decryption from that file. I am using C#. Do I need to implement my own file format? Please help me.

i belive it's Unnecessary to ask you if you tried encrypting / decrypting some simple string.
try using those methods for saving they are soo simple:
System.IO.File.WriteAllBytes();
System.IO.File.WriteAllText();
System.IO.File.ReadAllBytes();
System.IO.File.ReadAllText();

Related

How to write encrypted data on Scrapy (using Feed Export)?

I'm quite new to Scrapy, started using a week ago, and I use the -o property in the command line to generate a file and I'd like that file to be encrypted. I believe I need to write a custom Feed Exporter (instead of Item Exporter, because I need to encrypt the whole file and not each item separately), but I honestly have no idea how. I'm kinda lost, I read the scrapy docs, but they are not very clear and detailed.
Note: I also use custom settings like 'FEED_EXPORT_FIELDS' that I'd like to keep working.
For anyone in the future trying to solve this problem, I created a custom pipeline. I instantiate an exporter in open_spider, and in close_spider I call exporter.finish_exporting() and when I access the file after the method all the scraped items are written in it. Before returning I read all the data from the file, truncate the file, encrypt the data and then write it again. Then I just close the file and pass.

Database with Blob field unknown format. How to extract?

the story behind this is a bit funny. I had a diary on ios, the app isn't available anymore so I switched to another app. Could backup the database.
I know the column where the text is stored. Unfortunately, it is in a blob format. The database is a sqllite file.
Is there a way to find out what the true format is and somehow convert it back to text? At the beginning I thought it's just a sql command but I wasn't successful.
Do you have any Idea or an appraoch how to solve that ?
PS:
That is the beginning of one blob file: 'É' ¥I±00n'.
And here is the same in hex:14C9271E2005A549B130308E8F6ECF69A74A
Could only put the beginning here, since I really don't know what is written there.

how to save binarystream as a media file

I have binary asd i want to save as a myvideo.mp4, So my question is that if you have binary and you want to store your file,
So how it would accomplished any one idea i didn't work yet with binary and streaming i am new with these all things so if any one know please share a piece of example which solve my problem.
like response.outStream in this i am getting binary so can i save as a myvideo.mp4 what would be that process actually this binary is generating for mp4 conversion so any idea.
thanks.
You will need to create a FileStream to write to and then you will read the source stream in a loop, reading a block and then writing that block to the FileStream. It should be fairly easy to find an example of reading a stream in a loop using its Read method.

Reading encrypted (?) SQLite files from POS

I'm trying to get to the original data stored on a Micros POS.
Under the DB folder, I found over a 100 files, arranged in pairs: x.bin, x.key; y.bin, y.key etc. The file names look like table names, and each has a .key and a .bin.
After searching a lot, I got hints and rumors that the DB used by the POS is SQLite and that the files are encrypted, each with it's own key.
My question: is there a programmatic way to get at the data in those .bin files?
Bonus: is there a way to create one unencrypted SQLite file containing all tables and all data?
Thanks for your time!
Just staring at the encrypted files will not likely to do much good (unless you have experience with crypto analysis). However, if you have the whole firmware from the device, there's a simpler (IMO) way:
Find the code which works with those files (e.g. by searching for .key and .bin in files).
Reverse-engineer (disassemble/decompile) it and figure out what it does.
Reproduce the decryption step either manually or write a small program to do it.
Check if the decrypted data is SQLite format or not.

To read pdf in asp.net

I want to read pdf file and i want to store it's detail in my database.
But i could not read pdf file & store it in sql database in asp.net using c#. So, please give me a solution if anyone knows...
Very very thanx in advance
If you need to effectively parse the contents of the PDF file, you may want to use a PDF management library such as iTextSharp. Otherwise, you could just store the raw file contents using a binary field in your table.
Please see these article, May be these will help you.
http://www.codeproject.com/KB/string/pdf2text.aspx
http://www.codeproject.com/showcase/TallComponents.asp
Else if you can purchase adobe toolkit for this then it will very easy for you to play with PDF.

Resources