The code above creates 50 IoT things in AWS IoT and generate random client IDs, serial numbers, and activation codes for each device. It then publishes the device data as a JSON payload to the IoT topic accordingly, which in turn triggers the Lambda function:
Lambda uses the hash and range keys (serialNumber and clientId) to query the database and compare the database current pre-generated activation code to a code that is supplied by the device owner along with their email address. If the activation code matches the one from the database, the activation status and email details are updated in DynamoDB accordingly. If not, the user gets an error message stating that the code is invalid.
N-based encoding (where N is the base of the number system) was often used to convert binary data into a human-readable text. The most commonly used inactivation key is base32. The advantage of this encoding is a large alphabet consisting of numbers and letters that case insensitive. The downside is that this encoding is not implemented in the .NET standard library and you should implement it yourself. You can also use the hex encoding and base64 built into mscorlib. In my example base32 is used, but I will not give its source code here. There are many examples of base32 implementation on this site.
By far the most secure way to do it is to have a centralized database of (serial number, activation key) pairs and have the user activate over the internet so you can check the key locally (on the server).
The Smart Fridge captures everything from being powered up for the first time, to information about the clinic and its products. To dispense a vaccine, a physician logs into the kiosk software that controls the Smart Fridge. From there, if they extracted a vaccine, the Smart Fridge would open access to a single vial and record it. If they needed to add an item to the inventory, they would insert it directly into the corresponding slot. Once any process finishes, the kiosk sends the data to Azure and then to Dynamics, where inventory changes reflect. By assigning serial numbers to vaccines, you can make sure that the first vaccines you received are the first ones you apply to patients. By assigning batch numbers, you can customize the storage conditions of each kind of vaccine. Thus, you can prevent patients from ever receiving a spoiled, recalled, or the wrong vaccine. 2b1af7f3a8