# Encryption for progress

**URL:** https://forum.makecode.com/t/encryption-for-progress/5731
**Category:** Help
**Created:** [January 25, 2021, 1:20am UTC](https://forum.makecode.com/t/encryption-for-progress/5731 "2021-01-25T01:20:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)
#### Post date: [January 25, 2021, 1:20am UTC](https://forum.makecode.com/t/encryption-for-progress/5731/1 "2021-01-25T01:20:48Z")

</div>

Is there any extension that generates and reads progress codes for later use?

---

<div class="post-metadata">

### Author: ![TakeTheL08](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/takethel08/32/7018_2.png) [@TakeTheL08](https://forum.makecode.com/u/TakeTheL08)
#### Post date: [January 25, 2021, 4:01pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/2 "2021-01-25T16:01:42Z")

</div>

no but you could try to make it

---

<div class="post-metadata">

### Author: ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)
#### Post date: [January 25, 2021, 4:21pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/3 "2021-01-25T16:21:20Z")

</div>

This would need an algorithm, and it would need to apply to many things, like variables. It would probably be a `Encrypt()` and `Decrypt()`. This would be helpful for saving progress without people trying to skip levels.  
Like say `Encrypt(currentLevel)` to tell the password to the level, and then for the level `Decrypt(askForImput)`. Basically it just reads the password and returns it to it’s original value.

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [January 25, 2021, 4:21pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/4 "2021-01-25T16:21:51Z")

</div>

You have the settings extension which saves the data on the device hardware (cookies if using the simulator). It’s available in the extension menu.

---

<div class="post-metadata">

### Author: ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)
#### Post date: [January 25, 2021, 4:22pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/5 "2021-01-25T16:22:00Z")

</div>

Oooh. That could be fun to make.

What style of codes do you want? Numeric/Alphanumeric? 2D pictorial grid? Something else?

How much data do you want to store? Level number? Health value? Unlocked abilities?

---

<div class="post-metadata">

### Author: ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)
#### Post date: [January 25, 2021, 4:34pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/6 "2021-01-25T16:34:45Z")

</div>

Basically any string or number. It would just encrypt into something unreadable for humans like 12 to aiF82oF and then it could read it back aiF82oF to 12.

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 25, 2021, 5:24pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/7 "2021-01-25T17:24:51Z")

</div>

CRC32 hash? It accepts strings!

[http://www.sha1-online.com/](http://www.sha1-online.com/)

It also seems pretty easy to implement - this Stack Overflow answer does it in 5 lines:

> <https://stackoverflow.com/questions/1742866/compute-crc-of-file-in-python/2387880#2387880>

---

<div class="post-metadata">

### Author: ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)
#### Post date: [January 25, 2021, 5:40pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/8 "2021-01-25T17:40:09Z")

</div>

Good thinking, but a hash function is generally one-way. You’re going to need to both encode and decode the data for a save feature. (Though you could combine a hash of the original data _with_ the data to serve as a sort of checksum, if that’s what you were thinking.)

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 25, 2021, 5:56pm UTC](https://forum.makecode.com/t/encryption-for-progress/5731/9 "2021-01-25T17:56:09Z")

</div>

> [@jacob\_c](#):
>
> …but a hash function is generally one-way…

Did not think that far. 😅

> [@jacob\_c](#):
>
> (Though you could combine a hash of the original data _with_ the data to serve as a sort of checksum, if that’s what you were thinking.)

Yes, you could just append the string to the end of the hash and present that to the user but they would probably figure out how to break it.
