{"id":44480682,"url":"https://github.com/fsalinas26/cpp-login-menu","last_synced_at":"2026-02-12T23:19:49.910Z","repository":{"id":40602403,"uuid":"400659190","full_name":"fsalinas26/cpp-login-menu","owner":"fsalinas26","description":"A simple and ready-to-use ImGui login menu with a fully functioning NodeJS Server for storing user info using SQLite.","archived":false,"fork":false,"pushed_at":"2021-12-31T21:42:01.000Z","size":11346,"stargazers_count":24,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-10T10:17:47.884Z","etag":null,"topics":["imgui","login-screen","login-system","sqlite","user-interface"],"latest_commit_sha":null,"homepage":"","language":"C++","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/fsalinas26.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}},"created_at":"2021-08-27T23:40:33.000Z","updated_at":"2023-02-16T21:22:32.000Z","dependencies_parsed_at":"2022-09-04T12:01:26.390Z","dependency_job_id":null,"html_url":"https://github.com/fsalinas26/cpp-login-menu","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/fsalinas26/cpp-login-menu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsalinas26%2Fcpp-login-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsalinas26%2Fcpp-login-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsalinas26%2Fcpp-login-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsalinas26%2Fcpp-login-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsalinas26","download_url":"https://codeload.github.com/fsalinas26/cpp-login-menu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsalinas26%2Fcpp-login-menu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29386086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T22:07:52.078Z","status":"ssl_error","status_checked_at":"2026-02-12T22:07:49.026Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["imgui","login-screen","login-system","sqlite","user-interface"],"created_at":"2026-02-12T23:19:45.914Z","updated_at":"2026-02-12T23:19:49.905Z","avatar_url":"https://github.com/fsalinas26.png","language":"C++","readme":"# cpp-login-menu\nA simple and ready-to-use ImGui login menu with a fully functioning NodeJS Server for securely storing and accessing user info using SQLite.\n\u003cp align=\"center\"\u003e\n\u003ckbd\u003e\u003cimg height=\"400\" width = \"650\" src=\"https://i.gyazo.com/67c1d77797cb4ea84751cbd337ca99e4.gif\"/\u003e\u003c/kbd\u003e\n\u003c/p\u003e\n\n\n* [Database Structure](https://github.com/fsalinas26/cpp-login-menu#sqlite-database-structure)  \n* [Database Commands](https://github.com/fsalinas26/cpp-login-menu#database-commands)  \n* [HTTP Request](https://github.com/fsalinas26/cpp-login-menu#http-request-c++)\n* [REST API](https://github.com/fsalinas26/cpp-login-menu#rest-api-calls)\n* [Encryption](https://github.com/fsalinas26/cpp-login-menu#Encryption)  \n\n## SQLite Database Structure  \n| Column  | Type | Details |\n| ------------- |---| ------------- |\n| License |TEXT UNIQUE| For storing uuid4 serials.   |\n| Username |TEXT UNIQUE|For storing users usernames.  |\n| Password  |TEXT|MD5 Password for hash authentication.  |\n| HWID  |TEXT|MD5 Hardware Identifier to lock a license to a single PC.  |\n| LastLogin  |TEXT| Time of last users login.  |\n| LastIP  |TEXT|Most recent IP the user logged in with.  |\n| Expiry  |TEXT|Expiry date of the license.  |\n| UserVar  |TEXT|User variable that can be set to anything.  |\n| Rank  |INTEGER|Rank of license.  |\n| LastReset  |TEXT| Stores the last HWID reset time for cooldown period.  |\n\n## Database Commands  \nThese are a list of [functions](https://github.com/fsalinas26/cpp-login-menu/tree/master/NodeJS%20Server/Commands) that can be performed on the database to insert, modify, or delete table entries.\n*You can test most of these functions in Server.js or also use a REST Client to test the HTTP Request (use /admin route to bypass encryption). I plan on adding some kind of Admin Panel built into the menu to have control of all these callbacks*  \n\nEach command will take the form:  \n```javascript\nmodule.exports = {\n    name:\"login\", //the command name to be reference in the request ex. {\"command\": \"login\"}\n    adminOnly: false, //declare if the function can be only accessed with API Token\n    execute(db,body,out_obj,adminMode){//see below\n```\n**db** is the working sqlite database.  \n**body** is the incoming request body (JSON Object).  \n**out_obj** is the outgoing response JSON object (Use this to pass any data from the database to your client)  \n**adminMode** When true, certain commands will not have cooldown/argument restrictions (resethwid, resetpw)   \n\n### ChangePassword.js  \n**Name:** resetpw  \n**body**: username, license, newPassword  \nChanges the password of the table entry where both username and license are found.  \n\n### ChangeRank.js (Admin Only)  \n**Name:** rank  \n**body:** username,newRank  \nChanges the rank of the table entry where username is found.\n\n### CreateDB.js (Admin Only) **  \n**Name:** create  \nThis function should only be called once if you want to create a new database.  \n\n### ExtendLicense.js (Admin Only)   \n**Name:** extend  \n**body:** username, extendBy  \nExtends the expiry date of the table entry where username is found. **extendBy** takes days.  \n\n### GenerateKey.js (Admin Only)  \n**Name:** generate  \n**body:** length, rank  \nInserts a new license key into the table with length (in days) and rank.      \n\n### Login.js \n**Name:** login  \n**body:** username, password, HWID  \nReturns rank, user variable, expiry date, and login success if an entry is found in the table.  \n\n### LookupUser.js (Admin Only)  \n**Name:** find  \n**body:** entry  \nReturns all key/value data of a user where either username or license are found in the table.  \n\n### Redeem.js \n**Name:** redeem  \n**body:** username, password, hwid, license  \nPopulates an entry in the table where license is found.  \n\n### ResetHWID.js (AdminOnly)\n**Name:** resethwid  \n**body:** username, password (not required if calling from admin route)  \nResets the HWID of an entry in the table where username is found. The HWID reset cooldown can be set in config.json.  \n\n### ShowAllUsers.js (AdminOnly)\n**Name:** show  \n**body:** n/a  \nReturns an array of objects of all entries in the table.   \n\n## REST API Calls   \nTo test any of the commands, simply provide the command name and the respective fields for each function (shown above).  To test the calls w/o encryption, use the **/admin** endpoint instead of **/post**. Body of your request should be in JSON format.  \n**Generating a key**\n```\nPOST http://localhost:80/admin \nHTTP/1.1 content-type: application/json \nAuthorization: API_TOKEN\n\n{\n\"command\": \"generate\", \n\"length\": \"90\", \n\"rank\": \"2\", \n\"quantity\": \"1\"\n}\n```  \n**Changing users rank**\n```\nPOST http://localhost:80/admin \nHTTP/1.1 content-type: application/json \nAuthorization: API_TOKEN\n\n{\n\"command\": \"rank\", \n\"username\": \"fsalinas26\", \n\"newRank\": \"2\"\n}\n```  \n[See .rest file](https://github.com/fsalinas26/cpp-login-menu/blob/master/NodeJS%20Server/REST%20API/API.rest)  \n![](https://i.gyazo.com/38da51df2434d321eac2aa85625d55c1.png)\n\nYour API_TOKEN is declared in *config.json* and should be a random string of characters strictly for admin access.  \n\n\n## HTTP Request C++\nEach request to the server will look similar. The content-type is **application/x-www-form-urlencoded**. \n\n*Example of login request*\n```js  \nrequest.add_field(\"command\", c_crypto::encrypt(\"login\", g_crypto.key, g_crypto.iv).c_str());                         //command name to process\nrequest.add_field(\"username\", c_crypto::encrypt(username, g_crypto.key, g_crypto.iv).c_str()); \nrequest.add_field(\"password\", c_crypto::encrypt(c_crypto::MD5_HASH(password), g_crypto.key, g_crypto.iv).c_str());\nrequest.add_field(\"hwid\", c_crypto::encrypt(c_crypto::MD5_HASH(HWID), g_crypto.key, g_crypto.iv).c_str());\nrequest.add_field(\"token\", c_crypto::encrypt(g_crypto.token, g_crypto.key, g_crypto.iv).c_str());\nrequest.add_field(\"iv\", (g_crypto.iv).c_str());                                                \n\nstring tempRes;\nvector\u003cwstring\u003e headers = { PUBLIC_TOKEN };\nsend.post(L\"http://localhost/post\", tempRes, request, headers);\n```  \n\n**Client Sends (encoded in x-www-form-urlencoded)...**\n```\ncommand=09i_bfA6N4jXPIAw3BlROQ\u0026username=GSAPIBQPtX41HpyrjS5QQg\u0026password=AauvnS62Zak5hXh7dlTVzgg2RrNbj0qj7_btyVoVoILwi1iRTJHDPQLPLJ-CiDGg\u0026hwid=VoQq3PCzdNpOiNxObbdaQhWriuiG0-X5zaUtb_UsJWBkAlZITieRPKamDvneEBbP\u0026token=cc5peF3JrISAlIFRs5YzHLlnQWDIHeQ8L5zkKoc0mss\u0026iv=uz3ubFnxgvXIStPXmnza0w\n```  \n**Server Receives...**  \n```js\n{\n  command: 'Pwn--MvlX_K_Krm9z2mXjA',\n  username: 'hL6grsJbu9TGp0jWnmIhIw',\n  password: 'h8p97AgXxlk8Ioy4dVDF1wEVxQXQ7oYDsR-AFvKLZcK97wpAsPQywjnrF-tChQDj',\n  hwid: 'jYaktfdazKlC-RUVhkmG1X2aPyUFTGJDe5gO1OtIiR2zYj8gZxXH3m05BTMcdW5w',\n  token: 'm2BLP2fsWgthAmFdCyMb_VIQ7XK-2S2f1BNG2SsthJ8',\n  iv: 'u47uPTJ122TGXHL3PiQ_7w'\n}\n```\n**After Decryption...**\n```js\n{\n  command: 'login',\n  username: 'fsalinas12',\n  password: '052A1A3C0142AD636571F88EA2506EAC',\n  hwid: 'B689E0F6033D6369780DD6E649A0DA29',\n  token: 'G5uqEUETtZvyQkuLvNO84A',\n  iv: 'u47uPTJ122TGXHL3PiQ_7w'\n}\n```\n\n## Encryption\nThe body of each HTTP request and response is encrypted using **AES-256-CBC** with a randomly generated session IV that is initialized from the server. Both client and server will have a shared secret key. Each generated IV is stored in memory on the server and will become invalid after 30 seconds or destroyed after single use.   \n\nEach client request will include a randomly generated sequence of bytes encrypted using the session IV, which the server will decrypt for the client to compare.  \nI made this visual to show how the client communicates with the server. \n![](https://i.gyazo.com/79d3e56cf9dd33d50355d041a7c8845f.jpg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsalinas26%2Fcpp-login-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsalinas26%2Fcpp-login-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsalinas26%2Fcpp-login-menu/lists"}