{"id":28232328,"url":"https://github.com/jalaj711/go-des","last_synced_at":"2025-07-29T01:37:47.954Z","repository":{"id":212823934,"uuid":"732394099","full_name":"jalaj711/go-des","owner":"jalaj711","description":"GoLang implementation of DES, 3DES (128-bit key) and 3DES (192-bit key) with support for ECB, CBC, CFB and OFB modes.","archived":false,"fork":false,"pushed_at":"2023-12-21T07:54:20.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T15:44:43.649Z","etag":null,"topics":["3des","cryptography","des","golang","symmetric-cryptography"],"latest_commit_sha":null,"homepage":"","language":"Go","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/jalaj711.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-16T14:31:14.000Z","updated_at":"2025-02-04T15:55:04.000Z","dependencies_parsed_at":"2023-12-19T07:51:29.011Z","dependency_job_id":null,"html_url":"https://github.com/jalaj711/go-des","commit_stats":null,"previous_names":["jalaj711/go-des"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jalaj711/go-des","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalaj711%2Fgo-des","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalaj711%2Fgo-des/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalaj711%2Fgo-des/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalaj711%2Fgo-des/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jalaj711","download_url":"https://codeload.github.com/jalaj711/go-des/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalaj711%2Fgo-des/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267616848,"owners_count":24116170,"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-07-28T02:00:09.689Z","response_time":68,"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":["3des","cryptography","des","golang","symmetric-cryptography"],"created_at":"2025-05-18T20:08:54.844Z","updated_at":"2025-07-29T01:37:47.946Z","avatar_url":"https://github.com/jalaj711.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GO-DES\n\nA Golang implementation of the Data Encryption Standard (DES). This module provides the following functions:\n\n## Block level\n\n### Encrypt64\n\nThe Encrypt64 function signature is:\n\n```golang\nfunc Encrypt64(data [8]byte, key [8]byte) (encrypted [8]byte)\n```\n\nIt takes a 64-bit data block and a 64-bit key and returns an encrypted version of the plaintext which is also 64-bits. All the inputs and outputs are represented as byte arrays of fixed size 8.\n\n### Decrypt64\n\nThe Decrypt64 function signature is:\n\n```golang\nfunc Decrypt64(data [8]byte, key [8]byte) (decrypted [8]byte)\n```\n\nThis is the inverse of the `Encrypt64` function. It takes in a 64-bit ciphertext and a 64-bit key to generate a 64 bit plaintext version of it.\n\n## Primary encryption and decryption\n\n### Encrypt\n\nEncrypts using DES in ECB mode.\n\nThe Encrypt function signature is:\n\n```golang\nfunc Encrypt(data []byte, key [8]byte) (encrypted []byte)\n```\n\nIt takes a byte array and a 64-bit key and returns an encrypted version of the plaintext. All the inputs and outputs are represented as byte arrays. The input plaintext is first padded to 64-bits using PKCS7 padding.\n\n### Decrypt\n\nDecrypts using DES in ECB mode.\n\nThe Decrypt function signature is:\n\n```golang\nfunc Decrypt(data []byte, key [8]byte) (decrypted []byte, err error)\n```\n\nIt takes a byte array and a 64-bit key and returns an decrypted version of the ciphertext. All the inputs and outputs are represented as byte arrays. Padding is removed from the decrypted plaintext using PKCS7 padding scheme. Error is raised if input is not a multiple of 64 bits or if padding is invalid.\n\n## Modes of operation\n\n### Encrypt_CBC\n\nEncrypts using DES in CBC mode.\n\nFunction signature is\n\n```golang\nfunc Encrypt_CBC(plaintext []byte, key [8]byte, iv [8]byte) (ciphertext []byte)\n```\n\n### Decrypt_CBC\n\nDecrypts using DES in CBC mode.\n\nFunction signature is\n\n```golang\nfunc Decrypt_CBC(ciphertext []byte, key [8]byte, iv [8]byte) (plaintext []byte, err error)\n```\n\n### Encrypt_CFB8\n\nEncrypts using DES in CFB mode with 8-bit transmission.\n\nFunction signature is\n\n```golang\nfunc Encrypt_CFB8(plaintext []byte, key [8]byte, iv [8]byte) (ciphertext []byte, err error)\n```\n\n### Decrypt_CFB8\n\nDecrypts using DES in CFB mode with 8-bit transmission.\n\nFunction signature is\n\n```golang\nfunc Decrypt_CFB8(ciphertext []byte, key [8]byte, iv [8]byte) (plaintext []byte, err error)\n```\n\n### Encrypt_OFB\n\nEncrypts using DES in OFB mode.\n\nFunction signature is\n\n```golang\nfunc Encrypt_OFB(plaintext []byte, key [8]byte, nonce [8]byte) (ciphertext []byte, err error)\n```\n\n### Decrypt_OFB\n\nDecrypts using DES in CFB mode.\n\nFunction signature is\n\n```golang\nfunc Decrypt_OFB(ciphertext []byte, key [8]byte, nonce [8]byte) (plaintext []byte, err error)\n```\n\n## Triple DES\n\nAll the methods defined above are also available in their 3DES versions. Prefixing any of the methods above with `TripleDES128_` will give you it's 2 Key 3DES version. All such methods take 128-bit (16-byte) keys. Similiarly, prefixing with `TripleDES192_` will give you it's 3 Key 3DES version. These methods take 192-bit (24-byte) keys. Besides key-length all functions have the same signature as their normal DES counterparts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalaj711%2Fgo-des","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjalaj711%2Fgo-des","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalaj711%2Fgo-des/lists"}