Commit 66b28216 authored by Håkon Harnes's avatar Håkon Harnes

added token validation

parent a97614a0
......@@ -4,6 +4,8 @@
#include <openssl/evp.h>
#include <openssl/sha.h>
#include <string>
#include <sstream>
#include <fstream>
class Decryptor {
const std::string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
......
22 serialization::archive 16 0 0 0 0 53 /home/hakon/programming/security/Assignment 06/Task a 59 /home/hakon/programming/security/Assignment 06/Task a/build 0 0 106 0 0 0 1 # 1 1 1 2 18446744073709551615 7 include 1 2 1 9 18446744073709551615 15 "Decryptor.hpp" 1 10 1 25 18446744073709551615 3 std 3 1 3 4 0 2 :: 3 4 3 6 1 6 string 3 6 3 12 2 15 decryptPassword 3 13 3 28 1 1 ( 3 28 3 29 1 3 int 3 29 3 32 18446744073709551615 1 n 3 33 3 34 3 1 , 3 34 3 35 1 3 std 3 36 3 39 0 2 :: 3 39 3 41 18446744073709551615 6 string 3 41 3 47 2 8 password 3 48 3 56 4 1 ) 3 56 3 57 1 1 ; 3 57 3 58 18446744073709551615 3 int 5 1 5 4 18446744073709551615 4 main 5 5 5 9 5 1 ( 5 9 5 10 5 1 ) 5 10 5 11 5 1 { 5 12 5 13 18446744073709551615 5 const 6 3 6 8 18446744073709551615 3 std 6 9 6 12 0 2 :: 6 12 6 14 18446744073709551615 6 string 6 14 6 20 2 3 key 6 21 6 24 6 1 = 6 25 6 26 18446744073709551615 42 "ab29d7b5c589e18b52261ecba1d3a7e7cbf212c6" 6 27 6 69 18446744073709551615 1 ; 6 69 6 70 18446744073709551615 5 const 7 3 7 8 18446744073709551615 3 std 7 9 7 12 0 2 :: 7 12 7 14 18446744073709551615 6 string 7 14 7 20 2 4 salt 7 21 7 25 7 1 = 7 26 7 27 18446744073709551615 16 "Saltet til Ola" 7 28 7 44 18446744073709551615 1 ; 7 44 7 45 18446744073709551615 5 const 9 3 9 8 18446744073709551615 3 int 9 9 9 12 18446744073709551615 10 iterations 9 13 9 23 8 1 = 9 24 9 25 18446744073709551615 4 2048 9 26 9 30 18446744073709551615 1 ; 9 30 9 31 18446744073709551615 5 const 10 3 10 8 18446744073709551615 3 int 10 9 10 12 18446744073709551615 6 maxLen 10 13 10 19 9 1 = 10 20 10 21 18446744073709551615 2 10 10 22 10 24 18446744073709551615 1 ; 10 24 10 25 18446744073709551615 9 Decryptor 12 3 12 12 10 9 decryptor 12 13 12 22 11 1 ( 12 22 12 23 10 3 key 12 23 12 26 6 1 , 12 26 12 27 10 4 salt 12 28 12 32 7 1 , 12 32 12 33 10 10 iterations 12 34 12 44 8 1 , 12 44 12 45 10 6 maxLen 12 46 12 52 9 1 ) 12 52 12 53 10 1 ; 12 53 12 54 18446744073709551615 3 std 13 3 13 6 0 2 :: 13 6 13 8 18446744073709551615 6 string 13 8 13 14 2 8 password 13 15 13 23 12 1 = 13 24 13 25 18446744073709551615 9 decryptor 13 26 13 35 11 1 . 13 35 13 36 13 15 decryptPassword 13 36 13 51 13 1 ( 13 51 13 52 13 1 ) 13 52 13 53 13 1 ; 13 53 13 54 18446744073709551615 2 if 15 3 15 5 18446744073709551615 1 ( 15 6 15 7 18446744073709551615 8 password 15 7 15 15 12 2 != 15 16 15 18 14 2 "" 15 19 15 21 18446744073709551615 1 ) 15 21 15 22 18446744073709551615 3 std 16 5 16 8 0 2 :: 16 8 16 10 18446744073709551615 4 cout 16 10 16 14 15 2 << 16 15 16 17 16 20 "\nPASSWORD FOUND: " 16 18 16 38 18446744073709551615 2 << 16 39 16 41 16 8 password 16 42 16 50 12 2 << 16 51 16 53 16 4 "\n" 16 54 16 58 18446744073709551615 2 << 17 15 17 17 17 3 std 17 18 17 21 0 2 :: 17 21 17 23 18 4 endl 17 23 17 27 18 1 ; 17 27 17 28 18446744073709551615 4 else 18 3 18 7 18446744073709551615 3 std 19 5 19 8 0 2 :: 19 8 19 10 18446744073709551615 4 cout 19 10 19 14 15 2 << 19 15 19 17 16 33 "\nUNABLE TO DECRYPT PASSWORD!\n" 19 18 19 51 18446744073709551615 2 << 20 15 20 17 17 3 std 20 18 20 21 0 2 :: 20 21 20 23 18 4 endl 20 23 20 27 18 1 ; 20 27 20 28 18446744073709551615 216 /*
22 serialization::archive 17 0 0 0 0 54 /Users/hakon/programming/security/Assignment 06/Task a 60 /Users/hakon/programming/security/Assignment 06/Task a/build 0 0 106 0 0 0 1 # 1 1 1 2 18446744073709551615 7 include 1 2 1 9 18446744073709551615 15 "Decryptor.hpp" 1 10 1 25 18446744073709551615 3 std 3 1 3 4 0 2 :: 3 4 3 6 1 6 string 3 6 3 12 2 15 decryptPassword 3 13 3 28 1 1 ( 3 28 3 29 1 3 int 3 29 3 32 18446744073709551615 1 n 3 33 3 34 3 1 , 3 34 3 35 1 3 std 3 36 3 39 0 2 :: 3 39 3 41 18446744073709551615 6 string 3 41 3 47 2 8 password 3 48 3 56 4 1 ) 3 56 3 57 1 1 ; 3 57 3 58 18446744073709551615 3 int 5 1 5 4 18446744073709551615 4 main 5 5 5 9 5 1 ( 5 9 5 10 5 1 ) 5 10 5 11 5 1 { 5 12 5 13 18446744073709551615 5 const 6 3 6 8 18446744073709551615 3 std 6 9 6 12 0 2 :: 6 12 6 14 18446744073709551615 6 string 6 14 6 20 2 3 key 6 21 6 24 6 1 = 6 25 6 26 18446744073709551615 42 "ab29d7b5c589e18b52261ecba1d3a7e7cbf212c6" 6 27 6 69 18446744073709551615 1 ; 6 69 6 70 18446744073709551615 5 const 7 3 7 8 18446744073709551615 3 std 7 9 7 12 0 2 :: 7 12 7 14 18446744073709551615 6 string 7 14 7 20 2 4 salt 7 21 7 25 7 1 = 7 26 7 27 18446744073709551615 16 "Saltet til Ola" 7 28 7 44 18446744073709551615 1 ; 7 44 7 45 18446744073709551615 5 const 9 3 9 8 18446744073709551615 3 int 9 9 9 12 18446744073709551615 10 iterations 9 13 9 23 8 1 = 9 24 9 25 18446744073709551615 4 2048 9 26 9 30 18446744073709551615 1 ; 9 30 9 31 18446744073709551615 5 const 10 3 10 8 18446744073709551615 3 int 10 9 10 12 18446744073709551615 6 maxLen 10 13 10 19 9 1 = 10 20 10 21 18446744073709551615 2 10 10 22 10 24 18446744073709551615 1 ; 10 24 10 25 18446744073709551615 9 Decryptor 12 3 12 12 10 9 decryptor 12 13 12 22 11 1 ( 12 22 12 23 10 3 key 12 23 12 26 6 1 , 12 26 12 27 10 4 salt 12 28 12 32 7 1 , 12 32 12 33 10 10 iterations 12 34 12 44 8 1 , 12 44 12 45 10 6 maxLen 12 46 12 52 9 1 ) 12 52 12 53 10 1 ; 12 53 12 54 18446744073709551615 3 std 13 3 13 6 0 2 :: 13 6 13 8 18446744073709551615 6 string 13 8 13 14 2 8 password 13 15 13 23 12 1 = 13 24 13 25 18446744073709551615 9 decryptor 13 26 13 35 11 1 . 13 35 13 36 13 15 decryptPassword 13 36 13 51 13 1 ( 13 51 13 52 13 1 ) 13 52 13 53 13 1 ; 13 53 13 54 18446744073709551615 2 if 15 3 15 5 18446744073709551615 1 ( 15 6 15 7 18446744073709551615 8 password 15 7 15 15 12 2 != 15 16 15 18 14 2 "" 15 19 15 21 18446744073709551615 1 ) 15 21 15 22 18446744073709551615 3 std 16 5 16 8 0 2 :: 16 8 16 10 18446744073709551615 4 cout 16 10 16 14 15 2 << 16 15 16 17 16 20 "\nPASSWORD FOUND: " 16 18 16 38 18446744073709551615 2 << 16 39 16 41 16 8 password 16 42 16 50 12 2 << 16 51 16 53 16 4 "\n" 16 54 16 58 18446744073709551615 2 << 17 15 17 17 17 3 std 17 18 17 21 0 2 :: 17 21 17 23 18 4 endl 17 23 17 27 18 1 ; 17 27 17 28 18446744073709551615 4 else 18 3 18 7 18446744073709551615 3 std 19 5 19 8 0 2 :: 19 8 19 10 18446744073709551615 4 cout 19 10 19 14 15 2 << 19 15 19 17 16 33 "\nUNABLE TO DECRYPT PASSWORD!\n" 19 18 19 51 18446744073709551615 2 << 20 15 20 17 17 3 std 20 18 20 21 0 2 :: 20 21 20 23 18 4 endl 20 23 20 27 18 1 ; 20 27 20 28 18446744073709551615 220 /*
-- OUTPUT --
146a0ad2711640cb8cb2e40b1c27435c2e8ba3c3 - QwC
975f6b1a139b3be77ca83be02ce2946beb877be4 - QwD
ab29d7b5c589e18b52261ecba1d3a7e7cbf212c6 - QwE
PASSWORD FOUND: QwE
*/ 22 3 29 6 18446744073709551615 1 } 30 1 30 2 18446744073709551615 0 0 19 0 0 0 22 0 0 1 2 0 3 std 8 1 2 0 15 decryptPassword 20 1 2 0 10 string:std 10 1 2 0 67 3:33:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 10 1 2 0 67 3:48:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 8 1 2 0 4 main 9 1 2 0 67 6:21:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 67 7:21:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 67 9:13:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 68 10:13:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 4 1 2 0 9 Decryptor 9 1 2 0 68 12:13:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 68 13:15:/home/hakon/programming/security/Assignment 06/Task a/main.cpp 21 1 2 0 25 decryptPassword:Decryptor 8 1 2 0 14 operator!=:std 9 1 2 0 8 cout:std 8 1 2 0 12 operator:std 21 1 2 0 26 operator:basic_ostream:std 8 1 2 0 8 endl:std 0 0 2 0 0 0 67 /home/hakon/programming/security/Assignment 06/Task a/Decryptor.hpp 1600345515 62 /home/hakon/programming/security/Assignment 06/Task a/main.cpp 1600345510
\ No newline at end of file
*/ 22 3 30 6 18446744073709551615 1 } 31 1 31 2 18446744073709551615 0 0 19 0 0 0 22 0 0 1 2 0 3 std 8 1 2 0 15 decryptPassword 20 1 2 0 14 string:__1:std 10 1 2 0 68 3:33:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 10 1 2 0 68 3:48:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 8 1 2 0 4 main 9 1 2 0 68 6:21:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 68 7:21:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 68 9:13:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 69 10:13:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 4 1 2 0 9 Decryptor 9 1 2 0 69 12:13:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 9 1 2 0 69 13:15:/Users/hakon/programming/security/Assignment 06/Task a/main.cpp 21 1 2 0 25 decryptPassword:Decryptor 8 1 2 0 18 operator!=:__1:std 9 1 2 0 12 cout:__1:std 8 1 2 0 16 operator:__1:std 21 1 2 0 30 operator:basic_ostream:__1:std 8 1 2 0 12 endl:__1:std 0 0 2 0 0 0 68 /Users/hakon/programming/security/Assignment 06/Task a/Decryptor.hpp 1600414591 63 /Users/hakon/programming/security/Assignment 06/Task a/main.cpp 1600414633
\ No newline at end of file
set(CMAKE_C_COMPILER "/usr/bin/cc")
set(CMAKE_C_COMPILER "/Library/Developer/CommandLineTools/usr/bin/cc")
set(CMAKE_C_COMPILER_ARG1 "")
set(CMAKE_C_COMPILER_ID "GNU")
set(CMAKE_C_COMPILER_VERSION "9.2.1")
set(CMAKE_C_COMPILER_ID "AppleClang")
set(CMAKE_C_COMPILER_VERSION "11.0.0.11000033")
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
set(CMAKE_C_COMPILER_WRAPPER "")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
......@@ -10,18 +10,20 @@ set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
set(CMAKE_C_PLATFORM_ID "Linux")
set(CMAKE_C_PLATFORM_ID "Darwin")
set(CMAKE_C_SIMULATE_ID "")
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
set(CMAKE_C_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-9")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar")
set(CMAKE_C_COMPILER_AR "")
set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib")
set(CMAKE_C_COMPILER_RANLIB "")
set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCC )
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_C_ABI_COMPILED TRUE)
......@@ -44,8 +46,8 @@ set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information.
set(CMAKE_C_SIZEOF_DATA_PTR "8")
set(CMAKE_C_COMPILER_ABI "ELF")
set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
set(CMAKE_C_COMPILER_ABI "")
set(CMAKE_C_LIBRARY_ARCHITECTURE "")
if(CMAKE_C_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
......@@ -56,7 +58,7 @@ if(CMAKE_C_COMPILER_ABI)
endif()
if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
set(CMAKE_LIBRARY_ARCHITECTURE "")
endif()
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
......@@ -68,6 +70,7 @@ endif()
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include;/Library/Developer/CommandLineTools/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include")
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks")
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
set(CMAKE_CXX_COMPILER "/Library/Developer/CommandLineTools/usr/bin/c++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "GNU")
set(CMAKE_CXX_COMPILER_VERSION "9.2.1")
set(CMAKE_CXX_COMPILER_ID "AppleClang")
set(CMAKE_CXX_COMPILER_VERSION "11.0.0.11000033")
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98")
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20")
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
......@@ -12,18 +12,20 @@ set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
set(CMAKE_CXX_PLATFORM_ID "Linux")
set(CMAKE_CXX_PLATFORM_ID "Darwin")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
set(CMAKE_CXX_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar")
set(CMAKE_CXX_COMPILER_AR "")
set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_RANLIB "")
set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCXX )
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_CXX_ABI_COMPILED TRUE)
......@@ -40,15 +42,24 @@ if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP)
foreach (lang C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
endforeach()
endif()
endforeach()
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
set(CMAKE_CXX_COMPILER_ABI "ELF")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
set(CMAKE_CXX_COMPILER_ABI "")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
......@@ -59,7 +70,7 @@ if(CMAKE_CXX_COMPILER_ABI)
endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
set(CMAKE_LIBRARY_ARCHITECTURE "")
endif()
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
......@@ -71,6 +82,7 @@ endif()
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/usr/include/c++/v1;/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include;/Library/Developer/CommandLineTools/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks")
set(CMAKE_HOST_SYSTEM "Linux-5.3.0-64-generic")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "5.3.0-64-generic")
set(CMAKE_HOST_SYSTEM "Darwin-19.6.0")
set(CMAKE_HOST_SYSTEM_NAME "Darwin")
set(CMAKE_HOST_SYSTEM_VERSION "19.6.0")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_SYSTEM "Linux-5.3.0-64-generic")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "5.3.0-64-generic")
set(CMAKE_SYSTEM "Darwin-19.6.0")
set(CMAKE_SYSTEM_NAME "Darwin")
set(CMAKE_SYSTEM_VERSION "19.6.0")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "FALSE")
......
......@@ -19,6 +19,9 @@
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# if defined(__GNUC__)
# define SIMULATE_ID "GNU"
# endif
/* __INTEL_COMPILER = VRP */
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
......@@ -37,6 +40,17 @@
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
......@@ -106,48 +120,32 @@
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
# if defined(__ibmxl__)
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
# else
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
# endif
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
#elif defined(__ibmxl__) || (defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800)
# define COMPILER_ID "XL"
# if defined(__ibmxl__)
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
# else
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
# endif
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
# define COMPILER_ID "XL"
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
# define COMPILER_ID "VisualAge"
# if defined(__ibmxl__)
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
# else
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
# endif
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__PGI)
# define COMPILER_ID "PGI"
......@@ -172,6 +170,15 @@
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
# define COMPILER_ID "Fujitsu"
#elif defined(__ghs__)
# define COMPILER_ID "GHS"
/* __GHS_VERSION_NUMBER = VVVVRP */
# ifdef __GHS_VERSION_NUMBER
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
# endif
#elif defined(__TINYC__)
# define COMPILER_ID "TinyCC"
......@@ -181,6 +188,21 @@
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
......@@ -196,6 +218,13 @@
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
# define COMPILER_ID "ARMClang"
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
......@@ -249,28 +278,18 @@
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
# if defined(__VER__)
# if defined(__VER__) && defined(__ICCARM__)
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# endif
#elif defined(__ARMCC_VERSION)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
# define COMPILER_ID "SDCC"
# if defined(__SDCC_VERSION_MAJOR)
......@@ -284,27 +303,10 @@
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
# endif
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro"
# if defined(_SGI_COMPILER_VERSION)
/* _SGI_COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
# else
/* _COMPILER_VERSION = VRP */
# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__sgi)
# define COMPILER_ID "MIPSpro"
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
......@@ -363,9 +365,6 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
# define PLATFORM_ID "IRIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
......@@ -425,6 +424,14 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
# define PLATFORM_ID
# endif
#elif defined(__INTEGRITY)
# if defined(INT_178B)
# define PLATFORM_ID "Integrity178"
# else /* regular Integrity */
# define PLATFORM_ID "Integrity"
# endif
#else /* unknown platform */
# define PLATFORM_ID
......@@ -482,9 +489,50 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
# if defined(__ICCARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
# elif defined(__ICCRH850__)
# define ARCHITECTURE_ID "RH850"
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
# elif defined(__ICCRISCV__)
# define ARCHITECTURE_ID "RISCV"
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
# elif defined(__ICC430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__ghs__)
# if defined(__PPC64__)
# define ARCHITECTURE_ID "PPC64"
# elif defined(__ppc__)
# define ARCHITECTURE_ID "PPC"
# elif defined(__ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__x86_64__)
# define ARCHITECTURE_ID "x64"
# elif defined(__i386__)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
......
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.13
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/hakon/programming/security/Assignment 06/Task a")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/hakon/programming/security/Assignment 06/Task a/build")
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/hakon/programming/security/Assignment 06/Task a")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/hakon/programming/security/Assignment 06/Task a/build")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
......
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.13
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# The main recursive all target
all:
.PHONY : all
# The main recursive preinstall target
preinstall:
.PHONY : preinstall
# The main recursive clean target
clean:
.PHONY : clean
#=============================================================================
# Special targets provided by cmake.
......@@ -50,19 +35,37 @@ cmake_force:
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
CMAKE_COMMAND = /usr/local/Cellar/cmake/3.16.3/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
RM = /usr/local/Cellar/cmake/3.16.3/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = "/home/hakon/programming/security/Assignment 06/Task a"
CMAKE_SOURCE_DIR = "/Users/hakon/programming/security/Assignment 06/Task a"
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = "/home/hakon/programming/security/Assignment 06/Task a/build"
CMAKE_BINARY_DIR = "/Users/hakon/programming/security/Assignment 06/Task a/build"
#=============================================================================
# Directory level rules for the build root directory
# The main recursive "all" target.
all: CMakeFiles/main.dir/all
.PHONY : all
# The main recursive "preinstall" target.
preinstall:
.PHONY : preinstall
# The main recursive "clean" target.
clean: CMakeFiles/main.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target CMakeFiles/main.dir
......@@ -71,19 +74,14 @@ CMAKE_BINARY_DIR = "/home/hakon/programming/security/Assignment 06/Task a/build"
CMakeFiles/main.dir/all:
$(MAKE) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/depend
$(MAKE) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir="/home/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles" --progress-num=1,2 "Built target main"
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir="/Users/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles" --progress-num=1,2 "Built target main"
.PHONY : CMakeFiles/main.dir/all
# Include target in all.
all: CMakeFiles/main.dir/all
.PHONY : all
# Build rule for subdir invocation for target.
CMakeFiles/main.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start "/home/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles" 2
$(CMAKE_COMMAND) -E cmake_progress_start "/Users/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles" 2
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/main.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start "/home/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles" 0
$(CMAKE_COMMAND) -E cmake_progress_start "/Users/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles" 0
.PHONY : CMakeFiles/main.dir/rule
# Convenience name for target.
......@@ -96,11 +94,6 @@ CMakeFiles/main.dir/clean:
$(MAKE) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/clean
.PHONY : CMakeFiles/main.dir/clean
# clean rule for target.
clean: CMakeFiles/main.dir/clean
.PHONY : clean
#=============================================================================
# Special targets to cleanup operation of make.
......
/home/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles/rebuild_cache.dir
/home/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles/main.dir
/home/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles/edit_cache.dir
/Users/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles/rebuild_cache.dir
/Users/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles/edit_cache.dir
/Users/hakon/programming/security/Assignment 06/Task a/build/CMakeFiles/main.dir
const char features[] = {"\n"
"C_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304
"1"
#else
"0"
#endif
"c_function_prototypes\n"
"C_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
"1"
#else
"0"
#endif
"c_restrict\n"
"C_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L
"1"
#else
"0"
#endif
"c_static_assert\n"
"C_FEATURE:"
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
"1"
#else
"0"
#endif
"c_variadic_macros\n"
};
int main(int argc, char** argv) { (void)argv; return features[argc]; }
......@@ -6,7 +6,7 @@
#IncludeRegexTransform:
/home/hakon/programming/security/Assignment 06/Task a/Decryptor.hpp
/Users/hakon/programming/security/Assignment 06/Task a/Decryptor.hpp
iomanip
-
iostream
......@@ -17,8 +17,178 @@ openssl/sha.h
-
string
-
sstream
-