-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from dr8co/dev
Version 1.0.0 release
- Loading branch information
Showing
16 changed files
with
105 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
# Copyright (C) 2023 Ian Duncan <[email protected]> | ||
# Copyright (C) 2024 Ian Duncan <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -17,7 +17,7 @@ | |
cmake_minimum_required(VERSION 3.25) | ||
|
||
project(privacyShield | ||
VERSION 0.1.0 | ||
VERSION 1.0.0 | ||
DESCRIPTION "A suite of tools for privacy and security" | ||
LANGUAGES CXX) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
# Copyright (C) 2023 Ian Duncan <[email protected]> | ||
# Copyright (C) 2024 Ian Duncan <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
# Copyright (C) 2023 Ian Duncan <[email protected]> | ||
# Copyright (C) 2024 Ian Duncan <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
@@ -147,7 +147,11 @@ inline void renameAndRemove(const std::string &filename, int numTimes = 1) { | |
} | ||
|
||
fs::remove(path, ec); | ||
if (ec) std::cerr << "Failed to delete " << filename << ": " << ec.message() << '\n'; | ||
if (ec) { | ||
printColor("Failed to delete ", 'r', false, std::cerr); | ||
printColor(filename, 'm', false, std::cerr); | ||
printColor(std::format(": {}", ec.message()), 'r', true, std::cerr); | ||
} | ||
} | ||
|
||
/// \struct FileDescriptor | ||
|
@@ -236,7 +240,6 @@ void simpleShred(const std::string &filename, const int &nPasses = 3, bool wipeC | |
|
||
// Restore last write time | ||
fs::last_write_time(filename, initTime, ec); | ||
if (ec) ec.clear(); | ||
|
||
// Rename and remove the file | ||
renameAndRemove(filename, 3); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
@@ -95,13 +95,19 @@ int main(int argc, char **argv) { | |
throw std::runtime_error("Failed to initialize libsodium."); | ||
|
||
// Display information about the program | ||
std::cout << "\nPrivacy Shield 1.0.0\n" | ||
"Copyright (C) 2023 Ian Duncan.\n" | ||
"This program comes with ABSOLUTELY NO WARRANTY.\n" | ||
"This is a free software; you are free to change and redistribute it\n" | ||
"under the terms of the GNU General Public License v3 or later.\n" | ||
"For more information, see https://www.gnu.org/licenses/gpl.html.\n" | ||
<< std::endl; | ||
printColor("\nPrivacy Shield 1.0.0\n", 'c'); | ||
printColor("Copyright (C) 2024 Ian Duncan.\n", 'b'); | ||
|
||
printColor("This program comes with ", 'g'); | ||
printColor("ABSOLUTELY NO WARRANTY.", 'r'); | ||
|
||
printColor("\nThis is a free software; you are free to change and redistribute it\n" | ||
"under the terms of the ", 'g'); | ||
printColor("GNU General Public License v3 ", 'r'); | ||
printColor("or later.", 'g'); | ||
|
||
printColor("\nFor more information, see ", 'g'); | ||
printColor("https://www.gnu.org/licenses/gpl.html.\n", 'b', true); | ||
|
||
// All the available tools | ||
std::unordered_map<int, std::function<void(void)>> apps = { | ||
|
@@ -114,14 +120,14 @@ int main(int argc, char **argv) { | |
|
||
// Applications loop | ||
while (true) { | ||
std::cout << "-------------------------------------\n"; | ||
std::cout << "1. Manage passwords\n"; | ||
std::cout << "2. Encrypt/decrypt files\n"; | ||
std::cout << "3. Shred files\n"; | ||
std::cout << "4. Clear browser privacy traces\n"; | ||
std::cout << "5. Find duplicate files\n"; | ||
std::cout << "6. Exit\n"; | ||
std::cout << "-------------------------------------" << std::endl; | ||
printColor("-------------------------------------\n", 'c'); | ||
printColor("1. Manage passwords\n", 'b'); | ||
printColor("2. Encrypt/decrypt files\n", 'g'); | ||
printColor("3. Shred files\n", 'm'); | ||
printColor("4. Clear browser privacy traces\n", 'y'); | ||
printColor("5. Find duplicate files\n", 'b'); | ||
printColor("6. Exit\n", 'r'); | ||
printColor("-------------------------------------", 'c', true); | ||
|
||
int choice = getResponseInt("What would you like to do? (Enter 1 or 2, 3..)"); | ||
|
||
|
@@ -135,27 +141,27 @@ int main(int argc, char **argv) { | |
else printColor("Invalid choice!", 'r', true, std::cerr); | ||
|
||
} catch (const std::bad_function_call &bc) { // In case the std::function objects are called inappropriately | ||
std::cerr << "Bad function call: " << bc.what() << std::endl; | ||
printColor(std::format("Bad function call: {}", bc.what()), 'r', true, std::cerr); | ||
continue; | ||
|
||
} catch (const std::exception &ex) { | ||
std::cerr << "Error: " << ex.what() << std::endl; | ||
printColor(std::format("Error: {}", ex.what()), 'r', true, std::cerr); | ||
continue; | ||
|
||
} catch (...) { // All other exceptions, if any | ||
std::cerr << "An error occurred." << std::endl; | ||
printColor("An error occurred.", 'r', true, std::cerr); | ||
continue; | ||
} | ||
} | ||
|
||
return 0; | ||
|
||
} catch (const std::exception &ex) { | ||
std::cerr << "Error: " << ex.what() << std::endl; | ||
printColor(std::format("Error: {}", ex.what()), 'r', true, std::cerr); | ||
return 1; | ||
|
||
} catch (...) { | ||
std::cerr << "Something went wrong." << std::endl; | ||
printColor("Something went wrong.", 'r', true, std::cerr); | ||
return 1; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. | ||
// Copyright (C) 2023 Ian Duncan <[email protected]> | ||
// Copyright (C) 2024 Ian Duncan <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
Oops, something went wrong.