AES for new blank Desfire EV1 - aes

I now have a new Desfire EV1 card. And I want to set PICC master key with AES encryption. How could I do that? So far I can get the session key using single DES.

You need to obtain the datasheet from the manufacturer NXP. Debugging or reverse-engineering crypto-functionality without proper documentation is extremely hard.

One place to start might be libfreefare or its parent, nfc-tools.
http://code.google.com/p/nfc-tools/wiki/libfreefare

Related

Reading Dogbone (Magnus 3) sensor tags with Zebra RFD8500

I'am trying to read the new sensor tags Dogbone, (with Magnus S3 IC) but I don't have luck.
I'am using Zebra RFD8500 and programming with the Zebra SDK for Android.
I want to read the RSSI or the temperature values, but it seems the problem is with the Select command.
In either case, it is a two step procedure : 1) select command to match a specific tag pattern in a specific pointer address at the MEMORY_USER_BANK. Then the IC detect that have to store
the solicited value in a specific address at the MEMORY_RESERVED_BANK and 2) read the value, from the specific address at the MEMORY_RESERVED_BANK.
For the Select command (C1G2) I tried with Access-filters and Pre-Filters, but although the tag is matched, the IC doesn't store a value in the RESERVED Bank.
Somebody knows if Zebra APIs support the reading of this newers tags ? Or suggest me any other test?
Thanks a lot for your help
Regards.
It's possible to read the RSSI value with EPC Gen2 tags, so if the tag you're referring to supports this standard it should work.
Try downloading the Zebra RFID sample app > Perform inventory > If the tag is found it should display the RSSI. The sample app code can be found here
As for the temperature values try reading the USER memory in the sample app as well to see if you can get it.
I suggest using the SLS smartSLED; it has built-in functionality for the Magnus (Axzon) chip family (both S2 and S3).

Flutter Bluetooth printing to Zebra

I need to add printing functionality on a zebra zq520 bluetooth thermal printer.
I manage to do so using the flutter_blue plugin but I am not happy with the implementation.
I hate to break the string to smaller chunks in order to pass through bluetooth (and wait!!!!!).
I was wondering if there is a better approach, like the one we used in the (good?) old days of java for android using the android.bluetooth.BluetoothAdapter class
Thanks.
I ended up creating my own plugin.
source code
EDIT: 2021/11/29 integrate some comments from comments section
This code is not limited to zpl. In theory it can support every printer language that sends clear text to bluetooth serial
It is only for Android
For this source code to works as is:
You have to pair a bluetooth printer with name that starts with "zebra"
You have to send the zpl commands as string.
The easiest way to check that your zpl command is valid, is by using the ultra useful labelary viewer. The easiest way to test a label layout (font size, images, barcodes etc) is by using the above free service. in fact all you have to do, is to create the layout you need in labelary and the just copy the entire string from first ^XA to last ^XZ to FlutterCblue.printToBT. For example if you send this
printToBT("^XA
^FX Top section with logo, name and address.
^CF0,60
^FO50,50^GB100,100,100^FS
^FO75,75^FR^GB100,100,100^FS
^FO93,93^GB40,40,40^FS
^FO220,50^FDIntershipping, Inc.^FS
^CF0,30
^FO220,115^FD1000 Shipping Lane^FS
^FO220,155^FDShelbyville TN 38102^FS
^FO220,195^FDUnited States (USA)^FS
^FO50,250^GB700,3,3^FS
^FX Second section with recipient address and permit information.
^CFA,30
^FO50,300^FDJohn Doe^FS
^FO50,340^FD100 Main Street^FS
^FO50,380^FDSpringfield TN 39021^FS
^FO50,420^FDUnited States (USA)^FS
^CFA,15
^FO600,300^GB150,150,3^FS
^FO638,340^FDPermit^FS
^FO638,390^FD123456^FS
^FO50,500^GB700,3,3^FS
^FX Third section with bar code.
^BY5,2,270
^FO100,550^BC^FD12345678^FS
^FX Fourth section (the two boxes on the bottom).
^FO50,900^GB700,250,3^FS
^FO400,900^GB3,250,3^FS
^CF0,40
^FO100,960^FDCtr. X34B-1^FS
^FO100,1010^FDREF1 F00B47^FS
^FO100,1060^FDREF2 BL4H8^FS
^CF0,190
^FO470,955^FDCA^FS
^XZ")
You will get this:
One more thing: keep in mind that if you want to print special language characters (I need to print Greek) you have to find the correct font that is installed in your printer. For example: In order to print Greek characters I have to integrate this
^CWN,E:TT0003M_.FNT
just after the first ^XA. Then I use the N font in order to print Greek. It is very flexible if you understand the basics
Hope it helps

The best way to save game data in Unity that's secure & platfrom independent

I am looking for a way to save the users progress for my game, I am looking for something that can't be tampered with/modified. I would like to have to be able to be platform independent. And I would like it to be stored within the game files to the user can transfer their data to different computers (with a flash drive or something). (Correct me if I'm wrong in any area) But I believe because I need to to be secure and platform independent that removes player prefs from the equation. I know there is a way to save data by encrypting it with Binary, but I don't know how that works and if the user could transfer the data from computer to computer. Is there a better way of saving data? Is encrypting is through Binary the way to go? If so how would I do it? Thank you :) If you have any questions feel free to ask.
Edit: I understand nothing is completely secure, I'm looking for something that can stop the average user from going into a file, changing a float, and having tons and tons of money in game.
The previous answer mentiones two good methods for storing data (although there are still some quirks regarding writing files on different platforms), I'd like to add on to the subject of security, as mentioned in a comment here.
First of all, nothing is fully secure, there is always someone brighter out there that will find a flaw somewhere in your code, maybe unless you want full on crypto, which is not trivial with key management etc.
I understand from the question that he wants to prevent users from moving files between machines, or allow them to move the files between machines but seal them so that users cannot easily change data stored in them.
In either case, a trivial solution would work: generate a hashcode from your dataset, mangle with it a little bit (salt it or do whatever to jump to another hashcode). so you could have something like
{
"name"="john",
"score"="1234",
"protection"="043DA33C"
}
if the 'protection' field is a hashcode of "john1234", it will not match "john9999", hence if the user doesn't know how you salt your protection, you will be able to tell that the save has been tampered with
The first way to save data in unity is use PlayerPrefs, using for example:
PlayerPrefs.SetString("key","value");
PlayerPrefs.SetFloat("key",0.0f);
PlayerPrefs.SetInt("key",0);
PlayerPrefs.Save();
and for get, you only need
PlayerPrefs.GetString("key","default");
The second way and the way that permit you stored in a independent file is use serialization, my prefer way is a use the json file for it.
1) make a class that will store the data (not necessarily it need extends of monobehaviour:
[System.Serializable]
public class DataStorer {
public data1:String = "default value";
public data2:Int = 4;
public data3:bool = true;
....
}
and store it in another class with
DataStorer dataStorer = new DataStorer();
.... // some change in his data
string json = JsonUtility.ToJson(this, true);//true for you can read the file
path = Path.Combine(Application.persistantDataPath, "saved files", "data.json");
File.WriteAllText(path, json);
and for read the data
string json= File.ReadAllText(path);
DataStorer dataStorer = new DataStorer();
JsonUtility.FromJsonOverwrite(json, dataStorer);
and now you dateStorer is loaded with the data in your json file.
I found a link of data encryption tool, which is very helpful according to your need, as you want to secure data on device (nothing 100% secure), there are 3 mode to secure data, APP, Device and Encryption key, you can choose as per your need.
See this link, it may help you.
https://forum.unity.com/threads/data-encryption-tool-on-assets-store.738299/

Using barcode scanner to read barcode in forms 10g

I want to use barcode to read instead of using input from keyboard. I use Key Enter trigger and passing null against it but it did't fire. Any solution.....
I Googled for it and found this article. The pertinent line is
"In order to cause the key-next-item to execute you will need to ensure
the bar code reader sends a TAB key sequence at the end of each scan
so that the key-next-item trigger will fire."
I don't know whether that will solve your problem but the solution will probably be something along those lines: configuration of the reader.

Sending MMS on iPhone using CoreTelephony

I am interested in sending an MMS within a private application on the iPhone. A lot of the information I need is proprietary, and therefore I can't find it anywhere. Basically, I'm looking for the proper way to construct a CTMessage and encode it for MMS, and then sending it via one of the overloaded sendMMS functions. Thanks in advance.
For those interested: here is what I managed to dig up (&/OR piece together myself).
For every MMS, a CTMessage is allocated & initialized. addRecipient/setRecipient is called to do just that.
For each data/text section a CTMessagePart is built with its data and corresponding datatype, and then added to the CTMessage's items array. The first item in each MMS items array is always a CTMessagePart containing a SMIL-formatted layout that the recipient interprets to display the message. Each CTMessagePart following the first is in the order that it is referenced from the SMIL data.
Each (unmodifiied) iPhone has an instance of CTMessageCenter running, with the id sharedMessageCenter. Calling sharedMessageCenter's sendMMS, giving the id of the CTMessage you just created will automate the rest of the process. Essentially, the CTMessage is encoded using the CTMmsEncoder into an MMS-PDU hex string. (Not to sure of the correct name for it, hah). Anyways, sharedMessageCenter's send method will then send the (encoded) MMS to your provider's MMSC.
That pretty much sums it up, and should give anyone looking to head down that path a good place to start depending on what they're doing. I can do my best to answer any questions.