{"id":19059355,"url":"https://github.com/evertonsavio/cryptography-cmac-hmac","last_synced_at":"2025-06-27T19:32:08.549Z","repository":{"id":144462842,"uuid":"348838037","full_name":"evertonsavio/cryptography-cmac-hmac","owner":"evertonsavio","description":"Java cryptography with CMACs (Cipher-based message authentication codes) \u0026 HMAC (Keyed-Hash Message Authentication Code)","archived":false,"fork":false,"pushed_at":"2021-09-08T11:55:53.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T01:43:25.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evertonsavio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-03-17T20:06:39.000Z","updated_at":"2024-10-04T23:53:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"72ec474e-d3d6-42e6-b084-0bdcbe78654e","html_url":"https://github.com/evertonsavio/cryptography-cmac-hmac","commit_stats":null,"previous_names":["evertonsavio/cryptography-cmac-hmac"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/evertonsavio/cryptography-cmac-hmac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evertonsavio%2Fcryptography-cmac-hmac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evertonsavio%2Fcryptography-cmac-hmac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evertonsavio%2Fcryptography-cmac-hmac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evertonsavio%2Fcryptography-cmac-hmac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evertonsavio","download_url":"https://codeload.github.com/evertonsavio/cryptography-cmac-hmac/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evertonsavio%2Fcryptography-cmac-hmac/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262318999,"owners_count":23292991,"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":[],"created_at":"2024-11-09T00:08:13.692Z","updated_at":"2025-06-27T19:32:08.496Z","avatar_url":"https://github.com/evertonsavio.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"HMAC // CMAC - JAVA \u0026 Golang\n---\n### References  \n\n* https://stackoverflow.com/questions/60670117/cmac-aes-rfc-4493-calculation-in-java\n* https://web.fe.up.pt/~ee96100/projecto/Tabela%20ascii.htm  \n* https://stackoverflow.com/questions/6933039/convert-two-ascii-hexadecimal-characters-two-ascii-bytes-in-one-byte\n* https://mkyong.com/java/how-do-convert-byte-array-to-string-in-java/  \n* https://stackoverflow.com/questions/2817752/java-code-to-convert-byte-to-hexadecimal  \n* https://www.netjstech.com/2016/09/converting-string-to-bytearray-java.html  \n* https://www.loratools.nl/#/hex\n\n```\n    @Test\n    void contextLoads() {\n\n        byte a = (byte) 0b10010110;\n\n        System.out.println(\"A byte representation is: \" +  a);\n        int i = 150;\n        byte b = (byte) i; //0b11111101;\n\n        System.out.println(\"Decimal representation: \" + b);\n        System.out.println(\"Decimal unsigned representation: \" + Byte.toUnsignedInt(b));\n\n        System.out.println(\"HEX OF 150: \" + Integer.toHexString(150 \u0026 0xFF));\n        System.out.println(\"HEX OF -106: \" + Integer.toHexString(-106 \u0026 0xFF));\n\n        System.out.println(\"-----------------------------------------\");\n\n        String hex = \"FF\";\n        short i1 = Short.parseShort(hex.substring(0, 2), 16);\n        System.out.println(i1);\n        byte myByte = (byte) i1;\n        System.out.println(myByte);\n        System.out.println(Integer.toHexString(myByte \u0026 0xFF));\n\n        byte b2 = -1;\n        byte b3 = (byte) 0b11111111;\n        int s = 255;\n        byte b4 = (byte) s;\n        System.out.println(Byte.toUnsignedInt(b4));\n\n        System.out.println(\"b3: \" + b3);\n        System.out.println(Integer.toHexString(b2 \u0026 0xFF));\n        String hexCode = String.format(\"%02x\", Byte.parseByte(String.valueOf(b2)));\n        System.out.println(hexCode);\n\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevertonsavio%2Fcryptography-cmac-hmac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevertonsavio%2Fcryptography-cmac-hmac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevertonsavio%2Fcryptography-cmac-hmac/lists"}