{"id":21972105,"url":"https://github.com/douglasr/ciqtools-cryptography","last_synced_at":"2026-02-28T12:37:51.808Z","repository":{"id":227706207,"uuid":"722319605","full_name":"douglasr/ciqtools-cryptography","owner":"douglasr","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-28T16:29:35.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-28T18:05:06.521Z","etag":null,"topics":["ciq-tools","connect-iq","connectiq","monkeyc"],"latest_commit_sha":null,"homepage":"","language":"Monkey C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/douglasr.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-22T22:16:33.000Z","updated_at":"2024-08-28T16:26:57.000Z","dependencies_parsed_at":"2024-03-18T19:55:47.387Z","dependency_job_id":"c4254e34-7a5f-4d7c-82c7-b2cd15e7a98d","html_url":"https://github.com/douglasr/ciqtools-cryptography","commit_stats":null,"previous_names":["douglasr/ciqtools-cryptography"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasr%2Fciqtools-cryptography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasr%2Fciqtools-cryptography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasr%2Fciqtools-cryptography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasr%2Fciqtools-cryptography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douglasr","download_url":"https://codeload.github.com/douglasr/ciqtools-cryptography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227150602,"owners_count":17738312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ciq-tools","connect-iq","connectiq","monkeyc"],"created_at":"2024-11-29T15:01:43.390Z","updated_at":"2026-02-28T12:37:51.723Z","avatar_url":"https://github.com/douglasr.png","language":"Monkey C","funding_links":[],"categories":["Barrels"],"sub_categories":["Older resources"],"readme":"# CIQ Tools - Cryptography\n\n(c)2022-2025 Douglas Robertson\n\nAuthor: Douglas Robertson (GitHub: [douglasr](https://github.com/douglasr); Garmin Connect: dbrobert)\n\n## Overview\nAccess to built-in cryptography libraries was included in the Connect IQ SDK 3.0.0.\nHowever, the code for a simple encryption/decryption is not necessarily easy due to\nthe nature of cryptography. This barrel is an attempt to streamline the use of the\nConnect IQ Cryptography library.\n\n## License\nThis Connect IQ barrel is licensed under the \"MIT License\", which essentially means that\nwhile the original author retains the copyright to the original code, you are free to do\nwhatever you'd like with this code (or any derivative of it). See the LICENSE.txt file\nfor complete details.\n\n## Using the Barrel\nThis project cannot be used on it's own; it is designed to be included in existing projects.\n\n### Include the Barrel\nDownload the barrel file (and associated debug.xml) and include it in your project.\nSee [Shareable Libraries](https://developer.garmin.com/connect-iq/core-topics/shareable-libraries/) on the Connect IQ Developer site for more details.\n\n### Encrypting \u0026 Decrypting\nThe barrel currently only supports encrypting/decrypting with the AES128 cipher using ECB mode (additional functionally to be added to the barrel at some point); this necessitates a cipher of 16 bytes in length.\n\n#### Cipher Key\nThe process of encrypting and then decrypting requires a cipher key. If the encrypt/decrypt\nis done solely on the Garmin device, then the easiest, and perhaps safest, cipher key to use\nis the device's unique identifier. The encryption function expects the cipher to be a ByteArray so the library includes a function to convert the cipher string to a properly sized ByteArray.\n\n```\nvar uniqueID = System.getDeviceSettings().uniqueIdentifier\nvar cipherKey = CIQToolsCryptography.stringToCipherKey(uniqueID);\n```\n\nNOTE: The stringToCipherKey() function will truncate the cipher string as needed but will not pad the string if it is too short.\n\n### Encrypt\nA string is easily encrypted, using the cipher key ByteArray.\n\n```\nvar plainText = \"Monkey C is great!\";\nvar encryptedString = CIQToolsCryptography.encrypt(plainText, cipherKey);\n```\n\n### Decrypt\nThe process of decrypting is equally simple.\n\n```\nvar plainText = CIQToolsCryptography.decrypt(encryptedString, cipherKey);\n```\n\n## Contributing\nPlease see the CONTRIBUTING.md file for details on how contribute.\n\n### Contributors\n* [Douglas Robertson](https://github.com/douglasr)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasr%2Fciqtools-cryptography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglasr%2Fciqtools-cryptography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasr%2Fciqtools-cryptography/lists"}