18 lines
20 KiB
Rust
18 lines
20 KiB
Rust
|
use encrypted_images::decryption::images::decode_image_and_extract_text;
|
||
|
use encrypted_images::decryption::text::decrypts;
|
||
|
fn main() {
|
||
|
let encoded_image = "iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAA4QElEQVR4nO3cCWxkW3of9v+tfV+4FZcii1uxuDR7ff36db/uWTySxlomkjyyLNtyFFtWAjhQHMAxbMCOk0hAEiNRAmQBLBmCEjuIbdiwDFluy/LzeGY4zfdev252s5trcSkuRbKqyGIVi7Uv9/p/7r1FFl9TM2PLtkCBBxhMo8l363znd+453/kOm9K33v6OEh69i+2SGT1H80gflJEo22EZrgOHfkCaxD3/N/Gi24qRzU4M92fxNGrA47t3MD+ThtO6gLByE8oDP14v23Cz9DtYyN3EQ8cxZt8fwyhOsA4v3n/1r7FYA1LKNEzWdgxb12Hfn8C65UB9RnDsEUqnc7Dt+xC7GULtRQGVh05Mf2sR0a/cxy3I8ORfYmbDgScP7uCj2Tge+qN4Fm9g+sltxL7pQdFzCFt7HfePV/GduoJ7RuAFbqDWtY3e4BhES36yCrvdCWNmEnnjt2E03QAG1yC3yah9asDjL7yP56+WMXUnCMO/iqLQ60P2NI6MpOBul4TF3bu4VXPh+fhnKG8r6DGU1ZgePWiD9GkGL2sxRB6H4X4xhznnVyGfPoOpOgZFqaIytArb1jRQr6njU2zksWgH8jfG4fg4ipFqDW/bHHBJFeDYjmrPLVgGsyjbn6FueAzDTBHSz/7Ye9dgVwnsT//ovWuwqwT2p37k7jXYVQL7kz985xrsKoH9zB+9fQ12lcD+xFdvXYNdJbCf/qGb12BXCeyP/+D0NdhVAvupH7hxDXaVwL7+lalrsKsE9sf+yOQ12FUC+8kvT1yDXSWwn/jS+DXYVQL78S9GrsGuEth/8oWxa7CrBPa1J+FrsKsE9mOPR6/BrhLYj344cg12lcB+5NHwNdhVAvvhh0PXYFcJ7I9+MHgNdpXAvvogdA12lcB+6P2Ba7CrBPaD9/uvwa4S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LcEuwnDxwQb7RDnsMkWMCBhkmDpagX7hGDKu2AvCdZYJxg7dAb2bSwYRvGw+nmwj3WwMM7A6joYnxEcu3sRbIlgtwi2TLDpd8E217bwW38py8DO25/5W14sn0oE224BG1bT+n/2Z30Y9bMDLe2n/o8cVrfDwIAOtmhgXC1gbwlmEmBH52CHkxpYVxNMi+kMzEiw9wTYEsG+qIEZOD4CjPVPW0IH4/gUFYJZdTBODhWsroMZCGZugi0S7AaTIIKNtItKx3gLmAEJiwJLR70F7DnBGu+CvSJYbZNgoy1g38GCicXZ8ufBPtXBRs7BZB2MzwiO3b4ItkKwaYKtEmxKA+uuvcTuiQOBgVvw1Tfx3/5kgcN+3j78H/wMTiaYOIc1wQZVsG/+F170uhr8rvP2U//nKVa2R4CgDrZswOPbLWCLBDMIsONzsPS4BtZBsF2CwaDGdAZmJthdAbZCsCcamEkH6yRYSgfj+BQlgpl1ME4OFayqg5kIZmyCLRNskkkQwYbbRC1xrAXMhIStAQsDwKFXB3tBsNq7YPMEq2whLA1Dud8Em8WCZRAPi58H+0wDk4ZgMutg0MH4jODYTQ0sQbAbBIsSbIpgawSb0MC+0DGPP/cDXEMuaeWqhIf/vQ+St0GwvRawAfy5rx3gv3li5Xedtzrt7vx3J5Aro0CvDrZqwOObLWDLBIMAy56DZcY0sDaC7RFMNqkxPbpPsM90sNsCLEqwDzUwiw7Wvgbb0RQxCMbxKRoJxj6qYJwcKlhZB7MQTGqCrRJsnEkQwYb8olo/eg6WtBCsBouPUR26oYHNEazyLthbAbZDsEEo95pgn2DBNqB2aPa9VrCXWOQgpaQQTEYdzNAE20Fw9IYGliLYJMHWCTZBsA2CRTSw/+zGAr48fXHgP9/2shJqp3WsZxUMuCSlvdMktbsUfuVi+923Lvzi39uHsT4MdK9pYGsGPL7RAr
|
||
|
let extracted_text = decode_image_and_extract_text(encoded_image);
|
||
|
match extracted_text {
|
||
|
Some(encrypted_text) => {
|
||
|
let key = Some("your_secret_key"); // Replace with your actual key
|
||
|
let decrypted_text = decrypts(encrypted_text.as_str(), key.clone());
|
||
|
match decrypted_text {
|
||
|
Some(text) => println!("Decrypted Text:\n{}", text),
|
||
|
None => println!("Decryption failed."),
|
||
|
}
|
||
|
}
|
||
|
None => println!("Failed to decode the image and extract text."),
|
||
|
}
|
||
|
}
|