{"id":20079742,"url":"https://github.com/grachale/cipher_tga_files","last_synced_at":"2026-06-08T11:31:49.690Z","repository":{"id":185136823,"uuid":"673063860","full_name":"grachale/cipher_TGA_files","owner":"grachale","description":" Implementation of functions for a program that can encrypt and decrypt a TGA image file.","archived":false,"fork":false,"pushed_at":"2023-07-31T20:23:56.000Z","size":3002,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T01:20:46.923Z","etag":null,"topics":["cipher","cpp","openssl","tga-image"],"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/grachale.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}},"created_at":"2023-07-31T19:37:11.000Z","updated_at":"2024-02-24T04:39:04.000Z","dependencies_parsed_at":"2023-07-31T21:15:15.149Z","dependency_job_id":null,"html_url":"https://github.com/grachale/cipher_TGA_files","commit_stats":null,"previous_names":["grachale/cipher_tga_files"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grachale%2Fcipher_TGA_files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grachale%2Fcipher_TGA_files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grachale%2Fcipher_TGA_files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grachale%2Fcipher_TGA_files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grachale","download_url":"https://codeload.github.com/grachale/cipher_TGA_files/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241510435,"owners_count":19974230,"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":["cipher","cpp","openssl","tga-image"],"created_at":"2024-11-13T15:24:25.414Z","updated_at":"2025-11-27T11:06:04.706Z","avatar_url":"https://github.com/grachale.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cipher files with OpenSSL\n Implementation of functions for a program that can encrypt and decrypt a TGA image file.\n\n## Task Description:\nFor our task, we will consider a simplified form of an image represented in the TGA format.\n\n### Mandatory Header: \n18 bytes - we will not modify these bytes in any way, only copy them to the encrypted image.\n### Optional Header Part: \nThe size is calculated from the mandatory header part - we will treat this header part as image data, meaning we will encrypt it together with the image data without any changes.\n### Image Data: \nThe rest of the data.\n\n## Parameters of Implemented Functions:\n\nbool encrypt_data (const string \u0026 in_filename, const string \u0026 out_filename, crypto_config \u0026 config)\n\nin_filename: Input file name.\n\nout_filename: Output file name.\n\nconfig: Data structure crypto_config described below.\n\nThe return value is true in case of success, false otherwise. Failure occurs if the file is somehow invalid (missing mandatory header, unable to open, read, write, etc.) or if the invalid crypto_config cannot be repaired.\n\nThe function decrypt_data utilizes the same interface but performs the inverse operation with respect to encryption. It will copy the mandatory header, which is not encrypted, and then decrypt the rest of the file in the same way as encryption. In this case, valid decryption key and IV (if required) are expected to be passed. If these parameters are not provided, data cannot be decrypted, and the program should report an error (return false).\n\nThe data structure crypto_config contains:\n\nThe chosen block cipher specified by its name.\n\nSecret encryption key and its size.\n\nInitialization Vector (IV) and its size.\n\nDuring encryption, the following problem may arise: if the encryption key (or IV) is insufficient (i.e., its length is not at least as large as required by the chosen block cipher or completely missing), it must be safely generated. If the specified block cipher does not need an IV (and therefore may not be provided to you), do not generate a new IV! Remember to save any generated keys and IVs in the passed config structure!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrachale%2Fcipher_tga_files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrachale%2Fcipher_tga_files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrachale%2Fcipher_tga_files/lists"}