{"id":17164353,"url":"https://github.com/toolgood/rcx","last_synced_at":"2025-10-13T21:40:03.538Z","repository":{"id":38421193,"uuid":"116948408","full_name":"toolgood/RCX","owner":"toolgood","description":"The RCX algorithm is improved based on the RC4 algorithm, and performance is almost the same.","archived":false,"fork":false,"pushed_at":"2019-10-14T12:31:01.000Z","size":190,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-13T21:40:02.649Z","etag":null,"topics":["rc4","rc4-algorithm","rcx","rcx-algorithm"],"latest_commit_sha":null,"homepage":"","language":"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/toolgood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-10T11:23:12.000Z","updated_at":"2023-04-02T09:16:07.000Z","dependencies_parsed_at":"2022-08-18T08:20:32.475Z","dependency_job_id":null,"html_url":"https://github.com/toolgood/RCX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/toolgood/RCX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolgood%2FRCX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolgood%2FRCX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolgood%2FRCX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolgood%2FRCX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toolgood","download_url":"https://codeload.github.com/toolgood/RCX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolgood%2FRCX/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017051,"owners_count":26085951,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["rc4","rc4-algorithm","rcx","rcx-algorithm"],"created_at":"2024-10-14T22:51:41.572Z","updated_at":"2025-10-13T21:40:03.496Z","avatar_url":"https://github.com/toolgood.png","language":"C#","readme":" \n\nRCX算法基于RC4算法改进，性能相差不太。\n\nThe RCX algorithm is improved based on the RC4 algorithm, and performance is almost the same.\n \n#### RCX算法、RCY算法、RC4算法比较 （Comparisons of RCX, RCY and RC4 algorithms ）\n\n编码类型(Encoding)：ASCII\n\n密钥(secret key)：ToolGood  \n\n输出数据类型(output data type)：Base64_Url\n```` csharp\nRC4('ABCDDDDDDDDDDDDDDDDDDDDDD') =\u003e mR6mGyRZ9ElDV7acIA3dPq_MAN4CiyW9yA\n\nRC4('ACBDDDDDDDDDDDDDDDDDDDDDD') =\u003e mR-nGyRZ9ElDV7acIA3dPq_MAN4CiyW9yA\n\nRC4('CBADDDDDDDDDDDDDDDDDDDDDD') =\u003e mx6kGyRZ9ElDV7acIA3dPq_MAN4CiyW9yA\n\nRC4('1234567891234567891234567') =\u003e 6W7Wa1UrhzU-IsDrUHyvTdOxdah1-1TPuw\n\nRC4('1234567800034567891234567') =\u003e 6W7Wa1UrhzU3I8LrUHyvTdOxdah1-1TPuw\n\n \n\nRCX('ABCDDDDDDDDDDDDDDDDDDDDDD') =\u003e mQQrSDdzTV7_Ys3s0uMpSV3GD55mxHvFfg\n\nRCX('ACBDDDDDDDDDDDDDDDDDDDDDD') =\u003e mQXUsAPCJnW082ShRU_UUxFy2_CCGk04Zg\n\nRCX('CBADDDDDDDDDDDDDDDDDDDDDD') =\u003e m80-OvKvTV7_Ys3spYaA0HVreSyZrQPZDw\n\nRCX('1234567891234567891234567') =\u003e 6TvQKirJa30sDUWQjHVtuSNN_KoGIb7OVQ\n\nRCX('1234567800034567891234567') =\u003e 6TvQKirJa30lIP-dpT9y4eJPSNeMzFgrhA\n\n\nThreeRCX('ABCDDDDDDDDDDDDDDDDDDDDDD') =\u003e P7ZZsw0hmXDGylnYMCmiaISKsvmkQZCNJg\n\nThreeRCX('ACBDDDDDDDDDDDDDDDDDDDDDD') =\u003e TTsrMehtzvOWO7a-KYh9x6GQa36zNj8CTQ\n\nThreeRCX('CBADDDDDDDDDDDDDDDDDDDDDD') =\u003e Vui-aiMNvIK-ozqOUVsSccrM__W6arUJQQ\n\nThreeRCX('1234567891234567891234567') =\u003e sQAd5pyGScLkgfWt5sHaJsCCA_hRafzvgA\n\nThreeRCX('1234567800034567891234567') =\u003e dKT7qYYvWV-xjmLNCoM-HPcHZr-9ecilzg\n\n\nRCY('ABCDDDDDDDDDDDDDDDDDDDDDD') =\u003e RTpQcXF5L-ylWYGeWRf8wMCecXHy4ABlug\n\nRCX('ACBDDDDDDDDDDDDDDDDDDDDDD') =\u003e RTsgQRPAgEChJvK2tkMLtg55cXHAR68YBQ\n\nRCY('CBADDDDDDDDDDDDDDDDDDDDDD') =\u003e R19cceZXygsOfoDsJm4myqXgwMDAR68YBQ\n\nRCY('1234567891234567891234567') =\u003e NWB6fjYys97HT4T3sABUuXS7w5q3HR6PYw\n\nRCY('1234567800034567891234567') =\u003e NWB6fjYys97Own-xxp15AgUE60FYsAV_ZQ\n\n\nThreeRCY('ABCDDDDDDDDDDDDDDDDDDDDDD') =\u003e hSclXtNhUKgh5xD5LyGAp9a4eNH1btHobQ\n\nThreeRCY('ACBDDDDDDDDDDDDDDDDDDDDDD') =\u003e pR9wz1Pm18VHQVFttsYF3ryqR6RtipsVFw\n\nThreeRCY('CBADDDDDDDDDDDDDDDDDDDDDD') =\u003e Z5eewmvC6roXNLKFvzTn8_4IgIjtQco8xQ\n\nThreeRCY('1234567891234567891234567') =\u003e QQHv2CJoIoREo0VRVrH9QFYDl_piBJ9QbA\n\nThreeRCY('1234567800034567891234567') =\u003e ZacKM0jFxevnI39XuSWCxOu1nc4krgC2hA\n\n`````\n\n从上面的代码，可以明显看出RC4算法加密的缺点，而数据经过RCX算法加密后变得无序。\n\nFrom the above code, you can clearly see the shortcomings of RC4 algorithm encryption,But the data is encrypted by the RCX algorithm and becomes disordered. \n\n####  测试RCX、RCY算法的性能(Testing the performance of the RCX and RCY algorithm)\n\n数据长度(data length)：10000\n\n加密次数(encryption count)：1000\n \nRCX =\u003e 72ms\n\nRCY =\u003e 66ms\n\n\n\n#### 核心代码（Core code ）\nRCX算法采用[明文]与[密文]对密码盘进行调换，并且对 j 进行修改: j=j+[明文]+[密文] 。\n\nThe RCX algorithm uses [plain text] and [ciphertext] to swap the cipher disk, and modify j: j = j + [plain text] + [ciphertext].\n```` csharp\n    public class RCX\n    {\n         private const int keyLen = 256;\n \n        /// \u003csummary\u003e\n        /// Encrypt\n        /// \u003c/summary\u003e\n        /// \u003cparam name=\"data\"\u003e\u003c/param\u003e\n        /// \u003cparam name=\"pass\"\u003e\u003c/param\u003e\n        /// \u003creturns\u003e\u003c/returns\u003e\n        public static byte[] Encrypt(byte[] data, byte[] pass)\n        {\n            if (data == null) throw new ArgumentNullException(\"data\");\n            if (pass == null) throw new ArgumentNullException(\"pass\");\n\n            byte[] mBox = GetKey(pass, keyLen);\n            byte[] output = new byte[data.Length];\n            int i = 0, j = 0;\n            for (int offset = 0; offset \u003c data.Length; offset++) {\n                i = (++i) \u0026 0xFF;\n                j = (j + mBox[i]) \u0026 0xFF;\n\n                byte a = data[offset];\n                byte c = (byte)(a ^ mBox[(mBox[i] + mBox[j]) \u0026 0xFF]);\n                output[offset] = c;\n\n                byte temp2 = mBox[c];\n                mBox[c] = mBox[a];\n                mBox[a] = temp2;\n                j = (j + a + c);\n            }\n            return output;\n        }\n \n        private static byte[] GetKey(byte[] pass, int kLen)\n        {\n            byte[] mBox = new byte[kLen];\n            for (Int64 i = 0; i \u003c kLen; i++) {\n                mBox[i] = (byte)i;\n            }\n            Int64 j = 0;\n            for (Int64 i = 0; i \u003c kLen; i++) {\n                j = (j + mBox[i] + pass[i % pass.Length]) % kLen;\n                byte temp = mBox[i];\n                mBox[i] = mBox[j];\n                mBox[j] = temp;\n            }\n            return mBox;\n        }\n    }\n`````\n\n\n-----------------------------------\n推荐一款儿童教育小程序《宝宝计分板》，《宝宝计分板》采用积分奖惩制度，量化奖励、惩罚，给孩子一个明确可实现的目标，孩子通过做家务、练字、画画、学唱歌、跑步等任务来获得积分，达到足够积分就可以兑换奖品。\n\n![宝宝计分板](bbjfb.png)\n\n《宝宝计分板》符合以下几个教育心理学，（1）、奖励和惩罚（强化动机理论），（2）、表扬和鼓励（纠正动机、形成目标），（3）、多学多练（从量变到质变），（4）、延迟满足（提升自我控制能力），（5）细化小目标（目标越明确，越容易实现），（6）批评不翻旧账（减少二次伤害）。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolgood%2Frcx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoolgood%2Frcx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolgood%2Frcx/lists"}