UIImage to compressed and encrypted data [closed] - ios

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm trying to create and send an encrypted image via an iMessage app. I've never done something like this before and I'm not even really sure where to start.
I know that there are GitHub repos like this one that provide a lot of different encryption methods. I also know that Apple provides compression libraries on iOS. What I don't know is what algorithms and compression options to use.
I need it to be as small as possible, but still maintain a reasonably high image quality (think Instagram quality or higher).
Short version: What is the best way to compress and encrypt a UIImage on iOS?

Use ZIP for compression and AES for encryption. ZIP first and then encrypt, AES is available in the Common Crypto. There are many answers on SO about encryption with Common Crypto in iOS.
But how will the image get decrypted by the receiver and how will the encryption key be shared between the sender and receiver?
AES encryption increases the size by at most 16 bytes of padding.
On an iPhone 5S I get encryption speed of 440MB/s. Common Crypto uses the built-in encryption hardware, software implementations such as CryptoSwift are much (orders of magnitude) slower.

Related

Convert shp file or geojson to isobus iso-xml ISO 11783-10 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
has anyone had any experience with ISOBUS Iso-XML (ISO 11783-10)?
I would like to convert some geojson and/or shapefiles (.shp) to this format but am having trouble finding any information.
The specification of ISO 11783-10 is not free. You can buy the specification (google for "ISO 11783-10"), the documentation is high quality and affordable (I'm not affiliated in any way). The bought documents are distributed with some "license" and will be marked with your name, so buyers will be reluctant to share them. There are many concepts involved and details are cryptic, therefore you really need the specification to work with this format.
If you write source code encoding/decoding this format, it will depend on the specification. Distributing your source code + documentation might or might not infringe on the IP/license (I'm not a lawyer). Publishing detailed responses on this subject in open fora on the internet might or might not infringe.
There are quite some developers writing code which deals with ISO 11783-10, but I think the scarcity of freely available source code (e.g. on github) and open discussions on internet is a direct effect of the specification publication policy. It's sad because this domain is complex, has high impact, has many details which are very instance-specific (e.g. for a specific vehicle-manufacturer, accidental complexity), so open discussions and source code could improve productivity for many.
Agleader software SMS Basic has the option to export shapefiles to ISOBUS format.

Can we deliver HEIF images through a CDN? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I'd like to deliver HEIF images through a CDN such as Amazon CloudFront after release iOS11.
But we can't use Nokia's HEIF implementation for commercial purposes because of this license.
So I'm looking for an another method to encode HEIF images.
Accordig to Introducing HEIF and HEVC, HEIF images can only be created by iOS devices that have A10 Fusion chip.
we currently only have HEIF encode support and hardware on iOS with minimum configuration being the A10 Fusion chip, an example, of which, is the iPhone 7 and the iPhone 7 Plus.
Can we deliver HEIF images that are created by iPhone7 etc through a CDN?
Is this a patent infringement?
Apple is only talking about hardware-level encoding support. HEIF is a format developed by MPEG and isn't Apple-controlled. Usability and support are still limited, but AFAIK there aren't any technical or legal reasons why you cant use it anywhere (if supported):
More information and links to C++ and JS libraries here: https://nokiatech.github.io/heif/
The licensing issue you're concerned about is only for Nokia's reference implementation. My guess is that Apple is using their own implementation. Regardless, it's not something you need to be concerned about.
If for some reason you are looking to create HEIF images yourself, there's at least one open-source implementation currently available for commercial use. Specifically, GPAC. Though its license (LGPL) does have its own set of potential drawbacks for commercial projects.

Optimal compression quality for social media app? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Sorry if this has been addressed before, I searched it up and I couldn't seem to find a question like this. I am making a social media app, and I want to preserve the quality of the images as much as possible. To make a data representation of the image I am using "UIImageJPEGRepresentation" and I would like to know what an optimal setting for the compression quality is.
One big consequence of setting the quality below 1 is that the image uploads to my server in much less time. I have experimented with the compression and to me I can't really tell the difference between 0.6 and 1 unless I zoom in on a computer, but I just wanted to know if there was a number or range that would produce favorable results.
One of the interesting and evolving format is Webp format that Google has introduced. This article suggests that Facebook is also trying to use this format. To answer the exact question as to how much to compress please note the following:
-Format of the image(I assume yours is JPEG)
-Compression technique(Lossy or Lossless)
-Target devices(I assume yours is mobile)
Considering above parameters(and more) and looking at the dimensions of all social networking sites I suggest you to get the compression level high enough such that you can see a difference in the image quality on the computer, that way you would have found an optimal level, remember lower the better till it degrades. Additionally you can find the information at this.

Can't decrypt file, which was encrypted on server side with OpenSSL AES 256 CBC [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to solve this problem for a long time, but still can't get the result. I use this openssl library for iOS with this example code. If i encrypt data using this code, i also can decrypt this one. but if i encrypt data using Terminal and openssl command, encrypted file can't be decrypted with this code.. Is there some differences or some things, that don't let me finish decryption with success.. I'll be so glad to any advice or suggestion..
Thanks.
UPD:
command, which i used:
openssl aes-256-cbc -in test.pdf -out test.bin -kfile key -S salt_in_hex
What you are missing is that in the code example they are using a key and iv derivation function: `EVP_BytesToKey, not a raw key, google it. Also you are missing the iv which is essentially required for CBC mode.
Best not to use OpenSSL in iOS. Appel does not supply it because version updates are many times not backward compatible breaking older code. Best to use the CommonCrypto function supplied with iOS.
If you are interested in using security in a produce plan on several hundred hours learning about it. The encryption part is the simple part. If you are just playing with this to learn, consider some books like Applied Cryptography by Bruce Schneier and the Handbook of Applied Cryptography available free online. Even these badly scratch the surface of proper application of cryptography.

How can I compress and encrypt a large file without using external DLLs or runtimes? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am looking for a component or other technique to compress and encrypt multiple large files (files which exceed 4gb in size, and thus will not fit in the memory available to a win32 process) into a single file. I would like the encryption to be very strong (256 bit AES or better) but the compression doesn't matter to me.
Right now, I'm using the TJvZlibMultiple component which creates its own non-Zip file format, but I have to create the archive, then encrypt it in a separate step (I'm using DcpCrypt right now). I'd like to do the same in a single pass, using streams, without using memory equal to the size of the file (ergo, the compression and encryption should happen with streams, and not in memory).
I have seen, and don't want to use, anything that requires an external DLLs like the 7zip dll. Commercial tools are okay, or any code or sample Delphi sources, but I'm looking for a thorough implementation within Delphi not a thing that imports and invokes functions in a dll.
Take a look at DIZipWriter.
Supports 256 bit AES, streaming and compression.
Update:
Version 5 claims to have support for large sized (64bit) entries, DIZipWriter History.
You could take a look at FlexCompress by ComponentAce: http://www.componentace.com/compression_component_compression_delphi_encryption_delphi_flexcompress.htm
Check FlexCompress:
FlexCompress is a compression delphi component designed for creating archives with strong encryption and better compression rate than WinZip and RAR. Native VCL, no DLLs, no OCXs, provides compression for files, buffers, streams and strings, supports in-memory archives, compresses large files > 4 Gb with low memory consumption and lots of other useful features.
http://www.componentace.com/flexcompress_features.htm
by this link: http://delphi.about.com/od/toppicks/tp/delphi_zip.htm

Resources