Protect sqlite database from downloading - database

There is no solution to prevent to download a preloaded database in jailbreak iPhone.
Any way to get your SQLite DB off iPhone?
I think the only way is to encrypt a preloaded database (maybe encrypting only the data inside single fields where we don't need to search) and decrypt only when a View have to show the data.
(all this using a personal key, of course)
Do someone know how to do exactly and if there is a better solution?
I'm using Core Data but I can't decrypt NSString Attributes, I can decrypt only NSData but is not simple to create a sqlite db with Data (BLOB) fields containing text encrypted string.
Thanks!

Maybe I found a solution!
I try this code on iOS5 and iOS6 and it works great. Now I can encrypt a NSString with a personal keyword and get a NSString (with AES256 and Base64 encoding).
Actually, the code needs just a simple little modification to work with ARC.
https://github.com/dev5tec/FBEncryptor.git
If someone find a better solution, please, post here.
For a greatest solution, it could be very useful if there is a way to export encrypted fields in csv data from FileMaker or other, and import in a sqlite db. In that way we can preload the sqlite db in Core Data. The App can decrypt the fields just when the View have to show on the screen.

Related

Picture on phpmyadmin

I would like to put photos in my phpmyadmin database but I can't find the solution that allows me to do so. I made an image array with a varchar but I can't find the path that allows to put an image. I thank you in advance for helping a young beginner ❤️
The best solution is to store the image as a file on disk and put the path to the file in the database (as a varchar or some other text type), then your application references the file instead of loading the BLOB data directly from the database. There are performance reasons that are well documented elsewhere that explain the intricate details better than I can, but basically the database slows and the amount of disk space it takes up expands as you store the images in the database.
If you decide to defy that advice and store the image directly in the database, you shouldn't be using phpMyAdmin as your main interface. Don't get me wrong, it's fully capable of uploading the image, but presumably you'll have some custom application interface that you should be using instead that also does application-level logic. But that's not what you asked, so to do this in phpMyAdmin, there should be a "Browse" button near the field on the phpMyAdmin Insert page. This requires your column be some appropriate sort of binary such as BLOB.

How can I encrypt and decrypt data on client in Meteor React?

I'm currently working on a password managing application in Meteor React and can't seem to find a way to encrypt and decrypt data on the client, with MmongoDB storing the encrypted data.
To add a little background to the task and specify what I am trying to do:
This whole application is for one single company and users are the employees only. The passwords, along with username info and some other attributes are stored in folders and users get view and edit rights to data within the folder. Passwords (along with additional info) need to be encrypted, but multiple users need to be able to access them based on the rights given to them. So when the data is encrypted, say when a person creates a password, other users with the rights to do so need to be able to decrypt this data as well. However, the decryption needs to happen on client and the server can only ever access the encrypted data.
I have tried using planifica:encryption, because it has exactly what we need for our project, but I ran into some errors and I can't get past them nor find any article about them. I have heard of Mylar in some answers to similar questions, but both Mylar and Planifica don't seem to have been updated for a few years now. I know Node.js has a crypto module, but I am not sure whether it could be used to share encrypted data among users and most importantly, how to do so.
Is there any way to do what we need for this project? I should also point out that I am relatively new to meteor and I have not dealt with encryption whatsoever, so my understanding is rather limited.
Thank you for reading!
This very much depends on the encryption you are using, but since you are interested in decrypting things client-side, it sounds like what you are looking for is the SubtleCrypto web api.
That should be all you need on top of what Meteor already provides. You should be able to use a regular meteor collection and publication to share the encrypted data with your clients, and then let them decrypt it using the above linked decrypt function. One question I'd have is how you will be able to get the decryption key to your clients while hiding it from the server, but I assume you've got that part figured out somehow.

How to insert and retrieve picture in sqlite database in CN1

I have challenges in fetching picture saved as bytes in sqlite database in codename one. Pls is there any special way in codename one to get picture from the sqlite database?
I am using this code
byte[] img = r.getBlob(0);
pls is their anythng wrong here?. I need a snippet code that will fetch pictures from the database. Bcos my pictures must reside inside database for better calling. Thanks
I would avoid that and instead store the data as a file as the blob functionality is flaky across platforms. Save the path to the file (or its name) in sqlite and store the files in storage or filesystem.

Insert a image in imageview with url into sqlite DB without BLOB

I need to insert an image into a imageview with url into sqlite DB without using the BLOB, is possible??
Thanks in advance
Short answer: I am not aware of any way to save images in SQLite without using BLOBs, and BLOBs of images can be too large for the server to handle smoothly. But I won't claim to have thorough experience with SQLite, so there's a good chance I'm missing something.
Depending on what other resources are at your disposal, one solution would be to just store the url for the image in a TEXT type, but save the image in some other file system. Then when you want to display the image, query the database to get the address (plus whatever other relevant info), isolate it from the results, and query the file system for the image. Implementing this pattern will really depend on the environment your system will be working in; if it's an Android device, you can probably just refer to the filepath it started at, or save it to a dedicated folder; if it's a web interface, the images would most easily be saved as a sub-folder next to the web page(s) that use the images.

How save text, svg, html, css all together efficiently

In an application, I am using Fabric.js, which lets users write text, draw SVG's, insert images etc.
I want to know, what is the best way to store this data.
Requirements are:
Ability to query the data(text), which tells me that i should store it in DB (MySQL as of now)
I have images, and I am targeting IPad as well, so the images are important, as to how they are stored.
SVG's and HTML/CSS to be saved as well.
I also want to do versioning of the content, as Quora does it, so that a user can see the changes from the past version to the current version. This also includes the versioning of images and SVG's.
I am wondering how Google Docs does it, because they also store our documents, drawings etc.
What is the best way of doing this?
i dont known if it helps but, Opera browser offer an option to save the webpages to an unique file { mht extension }, this stores all the files { css, images, scripts, etc } in base64 encoded text for a later use { when the document is opened }... maybe this can be a way to store data :P
I manage a webapp where users generate reports, and found it more efficient to store images and binary files in the filesystem, and link to them from the database. Elements that are in xml or text are kept in the database for easier searching - in your case this would include css/html and svg (which is xml). Use the database for managing revisions.
Might also check out this thread on storing images in a database.
It looks like Frabic.js is using the node.js javascript webserver on the backend - haven't used this before, but you might investigate which databases are easiest to use with node.js:
node.js database
nodejs and database communication - how?
nodejs where to start?
If you want to query the text efficiently, then perhaps putting all bits of information into the DB separately is the most efficient. Maybe you with to play with OOXML or ODF, that may serve as container for all information you require, and then XML-storage (e.g. eXist) to store it and query (e.g. the text). As these standards are XML-based, you can transform them into HTML (e.g. here or here) but writing an online editor for this is something that monster like Google can do.
You can take a look at NoSQL databases like MongoDB or
CouchDB
See also Storing images in NoSQL stores

Resources