Save Key or String securely in app - Xamarin Form - c#

I’ve been following various articles and answers regarding saving
API keys / password / strings still havent gotten specifically that i have been searching.
The idea is to save KEY in a form of string in Xamarin.Form
where the KEY can be accessed while debugging
but should not be exposed if reversed engineered an APK or IPA file.
Stated by one of my colleague ‘Gradle’ used to do similar in android native
yet am unsure on it and where do i get it working in Xamarin.Forms with respect to iOS and Android
Any information related would be much helpful

Your best bet is to make use of SecureStorage this will use the platform specific secure stores to store the data you provide.
As pointed out in comments you should always operate under the assumption that someone will be able to gain access to your code and reverse engineer it. Using the secure stores per platform will require that anyone accessing the device will be able to unlock it via PIN or biometrics, depending on the device.

Related

Xamarin Forms Android - Scoped Storage Access (Android API 30)

Currently I'm in the process of updating my application to work with Android API 30 to comply with Googles new Privacy Rules. Prior to this I was using the "Use legacy storage" flag so I could access Public storage with ease once Read/Write permissions were achieved, however that's no longer available in the latest API.
For a temporary workaround I am using ACTION_OPEN_DOCUMENT_TREE or Intent.ActionOpenDocumentTree (In Xamarin) in order to gain read / write access to the device bluetooth folder (It has to be this folder as that's where im looking for the specific files).
Whilst this method works, it's not ideal for a regular user as it requires them to actually search and find the folder instead of just getting a pop up asking for access.
What the process currently looks like #1
What the process currently looks like #2
What the process currently looks like #3
Ideally what I'm after is Image 3 to be the only interaction the user has to perform in order to give access to this particular folder. However Xamarin Documentation isn't particuarly clear (Especially on these new storage API's) and was hoping someone could help point me in the right direction!
Any help would be greatly appreciated thanks :)

How to get a JSON file (or something similar) with lightning data from http://en.blitzortung.org?

I am currently working on my school project - Android app that informs you about strong lightning strikes near your house in real time.
There are some websites like blitzortung.org or lightningmaps.org (or other), any ideas how can I get nice output file from one of these sites, so that I can obtain geographical data, determine whether it is near your house or not, and send a push notification for user? Displaying the strikes on the map are not needed.
I am using an Android Studio, Visual Studio 2015 as well as MS SQL database.
Thanks
You can get complete source code for this from following URL
https://github.com/wuan/bo-android
It's using data from lightningmaps.org
You can give a try to Open Weather or check this answer.
For Push you can use FCM. Just google "How to implement GCM in android?" you will whole lot of help.
According to blitzortung forum:
Please remember that Blitzortung data may not be used for commercial
purposes. General operator data access info: login to your main
Blitzortung Org account, and click the 'compendium' link under
'project area'. If you haven't already, you might also see
http://www.lightningmaps.org/doc/intro

Encryption issue in windows phone 8

I'm designing a Windows Phone 8 app where I need to save certain credentials and message backups as a Parse object. So, while I'm taking data from the user end I want to preserve privacy of the clients. So, why not encrypt it. But then again I need to decrypt it back on client side. Say, there's a message "I'll be late". So, I want it to be encrypted to say "###%&**))^^^__673asdh" and saved in backend which makes absolute no sense to me. Again this encrypted message is read back to the front end client as and when required as the original message that he stored. Please suggest a good library. is AES a good option? Sorry for the question. I'm basically a noob in cryptography! Thanks.
If you are noob in cryptography - do not use encrytion/decryption primitives. Encryption/decryption method is only a part where proper use of the method is very important too. Try to find some crypto library that will do the work for you. At start you can read about Crypto++ library and BounceCastle, inspect the exmaples in this libraries.

Extract gps data storage

I am using dotSpatial labrary in c#, I only can read realtime data.
but my problem is this.. how could I extract gps data storaged in my usb-gps device (it is passive gps)?
device information
brand : landairsea
Model: Gps Tracking Key
webPage: http://www.landairsea.com/gps-tracker/gps-tracking-key
From looking at their user guide:
http://www.landairsea.com/downloads/past-track-10.pdf
You could use the past-track software to save the stored data as .las format.
I believe that DotSpatial has a LIDAR plug-in that can read .las files:
Dotspatial.Plugins.LiDAR
If you are asking how to write a C# replacement for the Past-Track program that connects directly to the USB however, I don't know exactly.
DotSpatial has a positioning library that is DotSpatial.Positioning that was originally ported from http://geoframework.codeplex.com/. It is possible that this utility will have the capability to connect to your device, but I think it would probably only support a limited subset of GPS devices, and I never used it myself at all.
Hopefully that information is a little helpful though and will point you in the right direction.
Edit:
I have downloaded the Past-Track 10 software that is designed to retrieve data from the unit. This in turn installed Antaris4 and u-blox5 USB drivers. I think this is half of what you will need to write a C# app that can talk to your GPS and do things in code. You can find the drivers on the web. I think I found it here:
http://www.driverguide.com/driver/detail.php?driverid=1869444
But make sure you find a version of the driver that matches your PC configuration (32/64 and correct operating system). Incidentally, that will probably mean you will need to make x86 and x64 builds for your C# app.
The next step is to find some documentation for it and then attempt to use the drivers from C#. So far I haven't found a good document showing how to work with the drivers, but I'm sure it exits. I will update with a link when I find it.

Windows Client application on USB stick with write protection

I need one or more approaches to realize the following scenarion:
Let's say we have a windows application (a journal) where journal entries are serialized as XML.
The application is on a usb stick and also the XML file.
The main problem is: no one should be able to write/delete the usb stick except the application itself.
I've read about usb sticks with mechanical or software write lock. But this would also disallow the application to write?!
I'm happy about any approaches.
p.s. It would be a .NET 3.5 WPF Application. But I think that doesn't matter the problem.
Thank you in advance
An idea would be two use 2 partitions. One readonly partition (there should be tools out there that can create cdfs partitions) with your application on it and another secured with a password only known by your App. Possibly Truecrypt or some other partition encryption tools have the needed feature.

Categories