diff --git a/GhettoCryptCLI/Bases.h b/GhettoCryptCLI/Bases.h index e553828..6ef690c 100644 --- a/GhettoCryptCLI/Bases.h +++ b/GhettoCryptCLI/Bases.h @@ -3,13 +3,12 @@ #include // Actually useful bases -static const std::string BASE_2 = "01"; -static const std::string BASE_8 = "01234567"; -static const std::string BASE_10 = "0123456789"; -static const std::string BASE_16 = "0123456789abcdef"; -static const std::string BASE_64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +static const std::vector BASE_2 = { "0","1" }; +static const std::vector BASE_8 = { "0","1","2","3","4","5","6","7"}; +static const std::vector BASE_10 = { "0","1","2","3","4","5","6","7","8","9" }; +static const std::vector BASE_64 = { "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/" }; -// Meme bases +// Fun bases static const std::vector BASE_UWU = { "uwu", "UwU", @@ -37,7 +36,6 @@ static const std::vector BASE_UWU = { "favowite", "kawaii", "rawr", - "xDDD", "keewl", "keeeewl", ":p", @@ -60,1042 +58,28 @@ static const std::vector BASE_UWU = { "twe", "best", "ruff", - "me" + "me", + "nyeko", + "eughh" }; -static const std::vector BASE_EMOJI = { - u8"\U0001F39F", - u8"\U0001F6A1", - u8"\U00002708", - u8"\U0001F6EC", - u8"\U0001F6EB", - u8"\U000023F0", - u8"\U00002697", - u8"\U0001F47E", - u8"\U0001F691", - u8"\U0001F3C8", - u8"\U0001F3FA", - u8"\U00002693", - u8"\U0001F4A2", - u8"\U0001F620", - u8"\U0001F627", - u8"\U0001F41C", - u8"\U0001F4F6", - u8"\U0001F504", - u8"\U00002652", - u8"\U00002648", - u8"\U00002935", - u8"\U00002934", - u8"\U0001F69B", - u8"\U0001F3A8", - u8"\U0001F632", - u8"\U0001F45F", - u8"\U0000269B", - u8"\U0001F346", - u8"\U0001F3E7", - u8"\U0001F697", - u8"\U0001F697", - u8"\U0001F476", - u8"\U0001F47C", - u8"\U0001F37C", - u8"\U0001F424", - u8"\U0001F6BC", - u8"\U0001F519", - u8"\U0001F42B", - u8"\U0001F3F8", - u8"\U0001F6C4", - u8"\U0001F388", - u8"\U0001F5F3", - u8"\U00002611", - u8"\U0001F34C", - u8"\U0001F3E6", - u8"\U0001F4B5", - u8"\U0001F4B6", - u8"\U0001F4B7", - u8"\U0001F4B4", - u8"\U0001F4CA", - u8"\U0001F488", - u8"\U000026BE", - u8"\U0001F3C0", - u8"\U0001F6C0", - u8"\U0001F6C1", - u8"\U0001F50B", - u8"\U0001F3D6", - u8"\U0001F43B", - u8"\U0001F493", - u8"\U0001F6CF", - u8"\U0001F37A", - u8"\U0001F514", - u8"\U0001F515", - u8"\U0001F6CE", - u8"\U0001F371", - u8"\U0001F6B2", - u8"\U0001F6B4", - u8"\U0001F459", - u8"\U0001F3B1", - u8"\U00002623", - u8"\U0001F426", - u8"\U0001F382", - u8"\U000023FA", - u8"\U00002663", - u8"\U00002666", - u8"\U000023EC", - u8"\U00002665", - u8"\U00002B1B", - u8"\U000023EA", - u8"\U000023EE", - u8"\U000025C0", - u8"\U000025FE", - u8"\U000025FC", - u8"\U00002712", - u8"\U00002753", - u8"\U000023E9", - u8"\U000023ED", - u8"\U000025B6", - u8"\U000023EF", - u8"\U000027A1", - u8"\U00002702", - u8"\U000025AA", - u8"\U00002660", - u8"\U0001F532", - u8"\U000023F9", - u8"\U00002600", - u8"\U0000260E", - u8"\U0000260E", - u8"\U0000267B", - u8"\U000023EB", - u8"\U0001F33C", - u8"\U0001F421", - u8"\U0001F4D8", - u8"\U0001F499", - u8"\U0001F417", - u8"\U0001F4A3", - u8"\U0001F516", - u8"\U0001F4D1", - u8"\U0001F4DA", - u8"\U0001F37E", - u8"\U0001F490", - u8"\U0001F3F9", - u8"\U0001F3B3", - u8"\U0001F466", - u8"\U0001F35E", - u8"\U0001F470", - u8"\U0001F309", - u8"\U0001F4BC", - u8"\U0001F494", - u8"\U0001F41B", - u8"\U0001F3D7", - u8"\U0001F32F", - u8"\U0001F68C", - u8"\U0001F68F", - u8"\U0001F464", - u8"\U0001F465", - u8"\U0001F335", - u8"\U0001F4C5", - u8"\U0001F4F7", - u8"\U0001F4F8", - u8"\U0001F3D5", - u8"\U0000264B", - u8"\U0001F56F", - u8"\U0001F36C", - u8"\U00002651", - u8"\U0001F5C3", - u8"\U0001F4C7", - u8"\U0001F5C2", - u8"\U0001F3A0", - u8"\U0001F38F", - u8"\U0001F408", - u8"\U0001F431", - u8"\U0001F639", - u8"\U0001F63C", - u8"\U000026D3", - u8"\U0001F4C9", - u8"\U0001F4C8", - u8"\U0001F4B9", - u8"\U0001F4E3", - u8"\U0001F9C0", - u8"\U0001F3C1", - u8"\U0001F352", - u8"\U0001F338", - u8"\U0001F330", - u8"\U0001F414", - u8"\U0001F6B8", - u8"\U0001F43F", - u8"\U0001F36B", - u8"\U0001F384", - u8"\U000026EA", - u8"\U0001F3A6", - u8"\U0001F251", - u8"\U0001F250", - u8"\U00003297", - u8"\U00003299", - u8"\U000024C2", - u8"\U0001F3AA", - u8"\U0001F3D9", - u8"\U0001F306", - u8"\U0001F3AC", - u8"\U0001F44F", - u8"\U0001F3DB", - u8"\U0001F37B", - u8"\U0001F4CB", - u8"\U0001F563", - u8"\U0001F557", - u8"\U0001F566", - u8"\U0001F55A", - u8"\U0001F560", - u8"\U0001F554", - u8"\U0001F55F", - u8"\U0001F553", - u8"\U0001F564", - u8"\U0001F558", - u8"\U0001F55C", - u8"\U0001F550", - u8"\U0001F562", - u8"\U0001F556", - u8"\U0001F561", - u8"\U0001F555", - u8"\U0001F565", - u8"\U0001F559", - u8"\U0001F55E", - u8"\U0001F552", - u8"\U0001F567", - u8"\U0001F55B", - u8"\U0001F55D", - u8"\U0001F551", - u8"\U0001F503", - u8"\U0001F501", - u8"\U0001F502", - u8"\U0001F4D5", - u8"\U0001F510", - u8"\U0001F4EA", - u8"\U0001F4EB", - u8"\U0001F302", - u8"\U00002601", - u8"\U0001F329", - u8"\U0001F327", - u8"\U0001F328", - u8"\U0001F32A", - u8"\U0001F378", - u8"\U000026B0", - u8"\U0001F4A5", - u8"\U0001F4A5", - u8"\U00002604", - u8"\U0001F5DC", - u8"\U0001F38A", - u8"\U0001F616", - u8"\U0001F615", - u8"\U0001F6A7", - u8"\U0001F477", - u8"\U0001F39B", - u8"\U0001F3EA", - u8"\U0001F35A", - u8"\U0001F36A", - u8"\U0001F373", - u8"\U000000A9", - u8"\U0001F6CB", - u8"\U0001F491", - u8"\U0001F404", - u8"\U0001F42E", - u8"\U0001F980", - u8"\U0001F4B3", - u8"\U0001F319", - u8"\U0001F3CF", - u8"\U0001F40A", - u8"\U0000274C", - u8"\U0001F38C", - u8"\U00002694", - u8"\U0001F451", - u8"\U0001F63F", - u8"\U0001F622", - u8"\U0001F52E", - u8"\U000027B0", - u8"\U0001F4B1", - u8"\U0001F35B", - u8"\U0001F36E", - u8"\U0001F6C3", - u8"\U0001F300", - u8"\U0001F5E1", - u8"\U0001F483", - u8"\U0001F361", - u8"\U0001F576", - u8"\U0001F4A8", - u8"\U0001F333", - u8"\U0001F69A", - u8"\U0001F3EC", - u8"\U0001F3DA", - u8"\U0001F3DC", - u8"\U0001F3DD", - u8"\U0001F5A5", - u8"\U0001F4A0", - u8"\U0001F3AF", - u8"\U0001F625", - u8"\U0001F61E", - u8"\U0001F635", - u8"\U0001F4AB", - u8"\U0001F6AF", - u8"\U0001F415", - u8"\U0001F436", - u8"\U0001F42C", - u8"\U0001F42C", - u8"\U0001F6AA", - u8"\U000027BF", - u8"\U0000203C", - u8"\U000023F8", - u8"\U0001F369", - u8"\U0001F54A", - u8"\U0001F53B", - u8"\U0001F53D", - u8"\U00002B07", - u8"\U0001F409", - u8"\U0001F432", - u8"\U0001F457", - u8"\U0001F42A", - u8"\U0001F4A7", - u8"\U0001F4C0", - u8"\U0001F4E7", - u8"\U0001F442", - u8"\U0001F33D", - u8"\U0001F33E", - u8"\U0001F30E", - u8"\U0001F30F", - u8"\U0001F30D", - u8"\U00002734", - u8"\U00002733", - u8"\U000023CF", - u8"\U0001F4A1", - u8"\U0001F50C", - u8"\U0001F526", - u8"\U0001F418", - u8"\U0001F3FB", - u8"\U0001F3FC", - u8"\U0001F3FD", - u8"\U0001F3FE", - u8"\U0001F3FF", - u8"\U0001F51A", - u8"\U00002709", - u8"\U00002709", - u8"\U0001F4E9", - u8"\U0001F3F0", - u8"\U0001F3E4", - u8"\U0001F332", - u8"\U00002049", - u8"\U0001F611", - u8"\U0001F47D", - u8"\U0001F441", - u8"\U0001F453", - u8"\U0001F440", - u8"\U0001F486", - u8"\U0001F60B", - u8"\U0001F631", - u8"\U0001F618", - u8"\U0001F613", - u8"\U0001F915", - u8"\U0001F624", - u8"\U0001F637", - u8"\U0001F645", - u8"\U0001F646", - u8"\U0001F62E", - u8"\U0001F630", - u8"\U0001F644", - u8"\U0001F61B", - u8"\U0001F61D", - u8"\U0001F61C", - u8"\U0001F602", - u8"\U0001F912", - u8"\U0001F636", - u8"\U0001F3ED", - u8"\U0001F342", - u8"\U0001F46A", - u8"\U0001F385", - u8"\U0001F4E0", - u8"\U0001F628", - u8"\U0001F3A1", - u8"\U000026F4", - u8"\U0001F3D1", - u8"\U0001F5C4", - u8"\U0001F4C1", - u8"\U0001F39E", - u8"\U0001F4FD", - u8"\U0001F525", - u8"\U0001F692", - u8"\U0001F387", - u8"\U0001F386", - u8"\U0001F313", - u8"\U0001F31B", - u8"\U0001F41F", - u8"\U0001F365", - u8"\U0001F3A3", - u8"\U0001F44A", - u8"\U0001F44A", - u8"\U000026F3", - u8"\U0000269C", - u8"\U0001F4AA", - u8"\U0001F4BE", - u8"\U0001F3B4", - u8"\U0001F633", - u8"\U0001F32B", - u8"\U0001F301", - u8"\U0001F463", - u8"\U0001F374", - u8"\U0001F37D", - u8"\U000026F2", - u8"\U0001F340", - u8"\U0001F5BC", - u8"\U0001F35F", - u8"\U0001F364", - u8"\U0001F438", - u8"\U0001F425", - u8"\U0001F626", - u8"\U000026FD", - u8"\U0001F315", - u8"\U0001F31D", - u8"\U000026B1", - u8"\U0001F3B2", - u8"\U00002699", - u8"\U0001F48E", - u8"\U0000264A", - u8"\U0001F47B", - u8"\U0001F467", - u8"\U0001F310", - u8"\U0001F31F", - u8"\U0001F410", - u8"\U0001F3CC", - u8"\U0001F393", - u8"\U0001F347", - u8"\U0001F34F", - u8"\U0001F4D7", - u8"\U0001F49A", - u8"\U0001F62C", - u8"\U0001F638", - u8"\U0001F600", - u8"\U0001F601", - u8"\U0001F497", - u8"\U0001F482", - u8"\U0001F3B8", - u8"\U0001F487", - u8"\U0001F354", - u8"\U0001F528", - u8"\U00002692", - u8"\U0001F6E0", - u8"\U0001F439", - u8"\U0001F45C", - u8"\U0001F64B", - u8"\U0001F423", - u8"\U0001F3A7", - u8"\U0001F649", - u8"\U0001F49F", - u8"\U0001F498", - u8"\U0001F49D", - u8"\U00002764", - u8"\U00002714", - u8"\U00002797", - u8"\U0001F4B2", - u8"\U00002757", - u8"\U00002757", - u8"\U00002763", - u8"\U00002B55", - u8"\U00002796", - u8"\U00002716", - u8"\U00002795", - u8"\U0001F681", - u8"\U00002388", - u8"\U000026D1", - u8"\U0001F33F", - u8"\U0001F33A", - u8"\U0001F460", - u8"\U0001F684", - u8"\U0001F685", - u8"\U0001F506", - u8"\U000026A1", - u8"\U0001F52A", - u8"\U0001F52A", - u8"\U0001F573", - u8"\U0001F36F", - u8"\U0001F41D", - u8"\U0001F6A5", - u8"\U0001F40E", - u8"\U0001F434", - u8"\U0001F3C7", - u8"\U0001F3E5", - u8"\U00002615", - u8"\U0001F32D", - u8"\U0001F336", - u8"\U00002668", - u8"\U0001F3E8", - u8"\U0000231B", - u8"\U000023F3", - u8"\U0001F3E0", - u8"\U0001F3D8", - u8"\U0001F3E1", - u8"\U0001F917", - u8"\U0001F4AF", - u8"\U0001F62F", - u8"\U0001F368", - u8"\U0001F3D2", - u8"\U000026F8", - u8"\U0001F47F", - u8"\U0001F4E5", - u8"\U0001F4E8", - u8"\U0001F481", - u8"\U00002139", - u8"\U0001F520", - u8"\U0001F524", - u8"\U0001F521", - u8"\U0001F522", - u8"\U0001F523", - u8"\U0001F3EE", - u8"\U0001F3EE", - u8"\U0001F383", - u8"\U0001F3EF", - u8"\U0001F38E", - u8"\U0001F47A", - u8"\U0001F479", - u8"\U0001F3E3", - u8"\U0001F530", - u8"\U0001F456", - u8"\U0001F579", - u8"\U0001F54B", - u8"\U0001F511", - u8"\U00002328", - u8"\U0001F51F", - u8"\U0001F458", - u8"\U0001F48F", - u8"\U0001F48B", - u8"\U0001F63D", - u8"\U0001F617", - u8"\U0001F61A", - u8"\U0001F619", - u8"\U0001F428", - u8"\U0001F3F7", - u8"\U0001F41E", - u8"\U0001F535", - u8"\U0001F537", - u8"\U0001F536", - u8"\U0001F534", - u8"\U0001F317", - u8"\U0001F31C", - u8"\U0000271D", - u8"\U0001F343", - u8"\U0001F4D2", - u8"\U0001F50D", - u8"\U0001F6C5", - u8"\U00002194", - u8"\U000021A9", - u8"\U00002B05", - u8"\U0001F34B", - u8"\U0000264C", - u8"\U0001F406", - u8"\U0001F39A", - u8"\U0000264E", - u8"\U0001F688", - u8"\U0001F517", - u8"\U0001F587", - u8"\U0001F981", - u8"\U0001F484", - u8"\U0001F512", - u8"\U0001F50F", - u8"\U0001F36D", - u8"\U0001F62D", - u8"\U0001F3E9", - u8"\U0001F48C", - u8"\U0001F505", - u8"\U0001F58A", - u8"\U0001F58D", - u8"\U0001F58B", - u8"\U0001F58C", - u8"\U0001F004", - u8"\U0001F468", - u8"\U0001F46B", - u8"\U0001F574", - u8"\U0001F472", - u8"\U0001F473", - u8"\U0001F45E", - u8"\U0001F45E", - u8"\U0001F570", - u8"\U0001F341", - u8"\U0001F356", - u8"\U000026AB", - u8"\U000026AA", - u8"\U0001F348", - u8"\U0001F4DD", - u8"\U0001F4DD", - u8"\U0001F54E", - u8"\U0001F6B9", - u8"\U0001F687", - u8"\U0001F3A4", - u8"\U0001F52C", - u8"\U0001F396", - u8"\U0001F30C", - u8"\U0001F690", - u8"\U0001F4BD", - u8"\U0001F4F1", - u8"\U0001F4F4", - u8"\U0001F4F2", - u8"\U0001F911", - u8"\U0001F4B0", - u8"\U0001F4B8", - u8"\U0001F412", - u8"\U0001F435", - u8"\U0001F69D", - u8"\U0001F391", - u8"\U0001F54C", - u8"\U0001F6E5", - u8"\U0001F6E3", - u8"\U0001F5FB", - u8"\U000026F0", - u8"\U0001F6B5", - u8"\U0001F6A0", - u8"\U0001F69E", - u8"\U0001F401", - u8"\U0001F42D", - u8"\U0001F444", - u8"\U0001F3A5", - u8"\U0001F5FF", - u8"\U0001F3B6", - u8"\U0001F344", - u8"\U0001F3B9", - u8"\U0001F3B5", - u8"\U0001F3BC", - u8"\U0001F485", - u8"\U0001F4DB", - u8"\U0001F3DE", - u8"\U0001F454", - u8"\U0001F18E", - u8"\U0000274E", - u8"\U0001F170", - u8"\U0001F171", - u8"\U0001F17E", - u8"\U0001F17F", - u8"\U0001F913", - u8"\U0001F610", - u8"\U0001F311", - u8"\U0001F41D", - u8"\U0001F31A", - u8"\U0001F4F0", - u8"\U0001F303", - u8"\U0001F6B3", - u8"\U000026D4", - u8"\U0001F6AB", - u8"\U0001F4F5", - u8"\U0001F51E", - u8"\U0001F6B7", - u8"\U0001F6AD", - u8"\U0001F6B1", - u8"\U00002197", - u8"\U00002196", - u8"\U0001F443", - u8"\U0001F4D3", - u8"\U0001F4D4", - u8"\U0001F529", - u8"\U0001F419", - u8"\U0001F362", - u8"\U0001F3E2", - u8"\U0001F6E2", - u8"\U0001F44C", - u8"\U0001F5DD", - u8"\U0001F474", - u8"\U0001F475", - u8"\U0001F549", - u8"\U0001F51B", - u8"\U0001F698", - u8"\U0001F68D", - u8"\U0001F694", - u8"\U0001F696", - u8"\U0001F4D6", - u8"\U0001F4D6", - u8"\U0001F4C2", - u8"\U0001F450", - u8"\U0001F513", - u8"\U0001F4ED", - u8"\U0001F4EC", - u8"\U000026CE", - u8"\U0001F4BF", - u8"\U0001F4D9", - u8"\U00002626", - u8"\U0001F4E4", - u8"\U0001F402", - u8"\U0001F4E6", - u8"\U0001F4C4", - u8"\U0001F4C3", - u8"\U0001F4DF", - u8"\U0001F334", - u8"\U0001F43C", - u8"\U0001F4CE", - u8"\U0000303D", - u8"\U0001F389", - u8"\U0001F6F3", - u8"\U0001F6C2", - u8"\U0001F43E", - u8"\U0001F43E", - u8"\U0000262E", - u8"\U0001F351", - u8"\U0001F350", - u8"\U0001F6B6", - u8"\U0000270F", - u8"\U0001F427", - u8"\U0001F614", - u8"\U0001F3AD", - u8"\U0001F623", - u8"\U0001F647", - u8"\U0001F64D", - u8"\U0001F64C", - u8"\U000026F9", - u8"\U0001F471", - u8"\U0001F64F", - u8"\U0001F4BB", - u8"\U000026CF", - u8"\U0001F416", - u8"\U0001F437", - u8"\U0001F43D", - u8"\U0001F4A9", - u8"\U0001F4A9", - u8"\U0001F4A9", - u8"\U0001F48A", - u8"\U0001F38D", - u8"\U0001F34D", - u8"\U00002653", - u8"\U0001F52B", - u8"\U0001F6D0", - u8"\U0001F0CF", - u8"\U0001F693", - u8"\U0001F6A8", - u8"\U0001F46E", - u8"\U0001F429", - u8"\U0001F37F", - u8"\U0001F4EF", - u8"\U0001F4EE", - u8"\U0001F372", - u8"\U0001F6B0", - u8"\U0001F45D", - u8"\U0001F357", - u8"\U0001F63E", - u8"\U0001F621", - u8"\U0001F4FF", - u8"\U0001F478", - u8"\U0001F5A8", - u8"\U0001F4E2", - u8"\U0001F49C", - u8"\U0001F45B", - u8"\U0001F4CC", - u8"\U0001F6AE", - u8"\U0001F407", - u8"\U0001F430", - u8"\U0001F3CE", - u8"\U0001F3CD", - u8"\U0001F4FB", - u8"\U0001F518", - u8"\U00002622", - u8"\U0001F683", - u8"\U0001F6E4", - u8"\U0001F308", - u8"\U0000270A", - u8"\U0000270B", - u8"\U0000270B", - u8"\U0001F590", - u8"\U0001F596", - u8"\U0001F40F", - u8"\U0001F400", - u8"\U0001F699", - u8"\U0001F34E", - u8"\U000000AE", - u8"\U0001F60C", - u8"\U0001F397", - u8"\U0001F6BB", - u8"\U0001F595", - u8"\U0001F49E", - u8"\U0001F380", - u8"\U0001F359", - u8"\U0001F358", - u8"\U0001F50E", - u8"\U0001F5EF", - u8"\U000021AA", - u8"\U0001F48D", - u8"\U0001F360", - u8"\U0001F916", - u8"\U0001F680", - u8"\U0001F5DE", - u8"\U0001F3A2", - u8"\U0001F413", - u8"\U0001F339", - u8"\U0001F3F5", - u8"\U0001F4CD", - u8"\U0001F6A3", - u8"\U0001F3C9", - u8"\U0001F3C3", - u8"\U0001F3C3", - u8"\U0001F3BD", - u8"\U00002650", - u8"\U000026F5", - u8"\U000026F5", - u8"\U0001F376", - u8"\U0001F4E1", - u8"\U0001F3B7", - u8"\U00002696", - u8"\U0001F3EB", - u8"\U0001F392", - u8"\U0001F982", - u8"\U0000264F", - u8"\U0001F4DC", - u8"\U0001F4BA", - u8"\U0001F648", - u8"\U0001F331", - u8"\U00002618", - u8"\U0001F367", - u8"\U0001F411", - u8"\U0001F6E1", - u8"\U000026E9", - u8"\U0001F6A2", - u8"\U0001F320", - u8"\U0001F6CD", - u8"\U0001F370", - u8"\U0001F6BF", - u8"\U0001F918", - u8"\U0001F5FE", - u8"\U0001F52F", - u8"\U0001F3BF", - u8"\U000026F7", - u8"\U0001F480", - u8"\U00002620", - u8"\U0001F6CC", - u8"\U0001F634", - u8"\U0001F4A4", - u8"\U0001F62A", - u8"\U0001F575", - u8"\U0001F355", - u8"\U0001F641", - u8"\U0001F642", - u8"\U0001F3B0", - u8"\U0001F6E9", - u8"\U0001F539", - u8"\U0001F538", - u8"\U0001F63B", - u8"\U0001F63A", - u8"\U0001F607", - u8"\U0001F60D", - u8"\U0001F608", - u8"\U0001F603", - u8"\U0001F605", - u8"\U0001F604", - u8"\U0001F606", - u8"\U0001F606", - u8"\U0001F60A", - u8"\U0001F60E", - u8"\U0001F60F", - u8"\U0001F6AC", - u8"\U0001F40C", - u8"\U0001F40D", - u8"\U0001F3D4", - u8"\U0001F3C2", - u8"\U00002744", - u8"\U00002603", - u8"\U000026BD", - u8"\U0001F366", - u8"\U0001F51C", - u8"\U00002198", - u8"\U00002199", - u8"\U0001F35D", - u8"\U00002747", - u8"\U00002728", - u8"\U0001F496", - u8"\U0001F64A", - u8"\U0001F508", - u8"\U0001F507", - u8"\U0001F509", - u8"\U0001F50A", - u8"\U0001F5E3", - u8"\U0001F4AC", - u8"\U0001F6A4", - u8"\U0001F577", - u8"\U0001F578", - u8"\U0001F5D3", - u8"\U0001F5D2", - u8"\U0001F41A", - u8"\U0001F4A6", - u8"\U0001F3C5", - u8"\U0001F433", - u8"\U0001F239", - u8"\U0001F234", - u8"\U0001F23A", - u8"\U0001F22F", - u8"\U0001F237", - u8"\U0001F236", - u8"\U0001F235", - u8"\U0001F21A", - u8"\U0001F238", - u8"\U0001F232", - u8"\U0001F233", - u8"\U0001F191", - u8"\U0001F192", - u8"\U0001F193", - u8"\U0001F194", - u8"\U0001F201", - u8"\U0001F202", - u8"\U0001F195", - u8"\U0001F196", - u8"\U0001F197", - u8"\U0001F198", - u8"\U0001F199", - u8"\U0001F19A", - u8"\U0001F3DF", - u8"\U0000262A", - u8"\U00002721", - u8"\U0001F689", - u8"\U0001F5FD", - u8"\U0001F682", - u8"\U0001F35C", - u8"\U000023F1", - u8"\U0001F4CF", - u8"\U0001F353", - u8"\U0001F399", - u8"\U000026C5", - u8"\U0001F31E", - u8"\U0001F33B", - u8"\U0001F305", - u8"\U0001F304", - u8"\U0001F307", - u8"\U0001F3C4", - u8"\U0001F363", - u8"\U0001F69F", - u8"\U0001F3CA", - u8"\U0001F54D", - u8"\U0001F489", - u8"\U0001F455", - u8"\U0001F455", - u8"\U0001F3D3", - u8"\U0001F32E", - u8"\U0001F38B", - u8"\U0001F34A", - u8"\U00002649", - u8"\U0001F695", - u8"\U0001F375", - u8"\U0001F4C6", - u8"\U0001F4DE", - u8"\U0001F52D", - u8"\U0001F4FA", - u8"\U0001F3BE", - u8"\U000026FA", - u8"\U0001F321", - u8"\U0001F914", - u8"\U0001F4AD", - u8"\U0001F5B1", - u8"\U0001F44D", - u8"\U0001F44D", - u8"\U0001F44E", - u8"\U0001F44E", - u8"\U0001F44E", - u8"\U000026C8", - u8"\U0001F3AB", - u8"\U0001F405", - u8"\U0001F42F", - u8"\U000023F2", - u8"\U0001F62B", - u8"\U0001F6BD", - u8"\U0001F5FC", - u8"\U0001F345", - u8"\U0001F445", - u8"\U0001F3A9", - u8"\U0001F51D", - u8"\U0001F5B2", - u8"\U0001F69C", - u8"\U00002122", - u8"\U0001F686", - u8"\U0001F68A", - u8"\U0001F68B", - u8"\U0001F6A9", - u8"\U0001F4D0", - u8"\U0001F531", - u8"\U0001F68E", - u8"\U0001F3C6", - u8"\U0001F379", - u8"\U0001F420", - u8"\U0001F3BA", - u8"\U0001F337", - u8"\U0001F983", - u8"\U0001F422", - u8"\U0001F500", - u8"\U0001F495", - u8"\U0001F46C", - u8"\U0001F46D", - u8"\U00002602", - u8"\U000026F1", - u8"\U0001F612", - u8"\U0001F984", - u8"\U0001F53A", - u8"\U0001F53C", - u8"\U00002195", - u8"\U0001F643", - u8"\U00002B06", - u8"\U0001F6A6", - u8"\U0001F4F3", - u8"\U0000270C", - u8"\U0001F4F9", - u8"\U0001F3AE", - u8"\U0001F4FC", - u8"\U0001F3BB", - u8"\U0000264D", - u8"\U0001F30B", - u8"\U0001F3D0", - u8"\U0001F318", - u8"\U0001F316", - u8"\U000026A0", - u8"\U0001F5D1", - u8"\U0000231A", - u8"\U0001F403", - u8"\U0001F6BE", - u8"\U0001F30A", - u8"\U0001F349", - u8"\U0001F3F4", - u8"\U0001F44B", - u8"\U0001F3F3", - u8"\U00003030", - u8"\U0001F312", - u8"\U0001F314", - u8"\U0001F314", - u8"\U0001F640", - u8"\U0001F629", - u8"\U0001F492", - u8"\U0001F3CB", - u8"\U0001F40B", - u8"\U00002638", - u8"\U0000267F", - u8"\U0001F447", - u8"\U00002755", - u8"\U0001F4AE", - u8"\U00002639", - u8"\U00002705", - u8"\U00002B1C", - u8"\U0001F448", - u8"\U000025FD", - u8"\U000025FB", - u8"\U00002B50", - u8"\U00002754", - u8"\U0001F449", - u8"\U000025AB", - u8"\U0000263A", - u8"\U0001F533", - u8"\U0001F325", - u8"\U0001F326", - u8"\U0001F324", - u8"\U0001F446", - u8"\U0000261D", - u8"\U0001F32C", - u8"\U0001F390", - u8"\U0001F377", - u8"\U0001F609", - u8"\U0001F43A", - u8"\U0001F469", - u8"\U0001F46F", - u8"\U0001F462", - u8"\U0001F45A", - u8"\U0001F452", - u8"\U0001F461", - u8"\U0001F6BA", - u8"\U0001F5FA", - u8"\U0001F61F", - u8"\U0001F381", - u8"\U0001F527", - u8"\U0000270D", - u8"\U0001F49B", - u8"\U0000262F", - u8"\U0001F910" +// Source: https://lakinkonieczny.wordpress.com/2012/12/06/dialogue-noises-agh-ugh-shh-and-so-much-more/ +static const std::vector BASE_UGH = { + "Agh!", + "Ugh", + "Shh!", + "Pft!", + "Aah!", + "Uaah!", + "Gah!", + "Grr...", + "Duh!", + "Psh!", + "Ah...", + "Er-", + "Huh...?", + "Uh-huh...", + "Nu-uh...", + "Bah!", + "Wha-?" }; diff --git a/GhettoCryptCLI/CMakeLists.txt b/GhettoCryptCLI/CMakeLists.txt index a161560..7e7f7a5 100644 --- a/GhettoCryptCLI/CMakeLists.txt +++ b/GhettoCryptCLI/CMakeLists.txt @@ -11,5 +11,6 @@ add_executable(GhettoCryptCLI CommandLineInterface.cpp Hazelnupp.cpp + StringTools.cpp main.cpp ) diff --git a/GhettoCryptCLI/CommandlineInterface.cpp b/GhettoCryptCLI/CommandlineInterface.cpp index 05bd9ad..c3a261b 100644 --- a/GhettoCryptCLI/CommandlineInterface.cpp +++ b/GhettoCryptCLI/CommandlineInterface.cpp @@ -64,22 +64,22 @@ void CommandlineInterface::Init(int argc, const char* const* argv) nupp.RegisterAbbreviation("-p", "--progress"); nupp.RegisterDescription("--iobase-2", "Interpret and format ciphertexts in base2"); - nupp.RegisterConstraint("--iobase-2", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-8", "--iobase-10", "--iobase-64", "--iobase-uwu", "--iobase-emoji" })); + nupp.RegisterConstraint("--iobase-2", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-8", "--iobase-10", "--iobase-64", "--iobase-uwu", "--iobase-ugh" })); nupp.RegisterDescription("--iobase-8", "Interpret and format ciphertexts in base8"); - nupp.RegisterConstraint("--iobase-8", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-10", "--iobase-64", "--iobase-uwu", "--iobase-emoji" })); + nupp.RegisterConstraint("--iobase-8", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-10", "--iobase-64", "--iobase-uwu", "--iobase-ugh" })); nupp.RegisterDescription("--iobase-10", "Interpret and format ciphertexts in base10"); - nupp.RegisterConstraint("--iobase-10", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-64", "--iobase-uwu", "--iobase-emoji" })); + nupp.RegisterConstraint("--iobase-10", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-64", "--iobase-uwu", "--iobase-ugh" })); nupp.RegisterDescription("--iobase-64", "Interpret and format ciphertexts in base64"); - nupp.RegisterConstraint("--iobase-64", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-10", "--iobase-uwu", "--iobase-emoji" })); + nupp.RegisterConstraint("--iobase-64", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-10", "--iobase-uwu", "--iobase-ugh" })); nupp.RegisterDescription("--iobase-uwu", "Interpret and format ciphertexts in base uwu"); - nupp.RegisterConstraint("--iobase-uwu", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-10", "--iobase-64", "--iobase-emoji" })); + nupp.RegisterConstraint("--iobase-uwu", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-10", "--iobase-64", "--iobase-ugh" })); - nupp.RegisterDescription("--iobase-emoji", "Interpret and format ciphertexts in base emoji (EXPERIMENTAL)"); - nupp.RegisterConstraint("--iobase-emoji", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-10", "--iobase-64", "--iobase-uwu" })); + nupp.RegisterDescription("--iobase-ugh", "Interpret and format ciphertexts in base ugh"); + nupp.RegisterConstraint("--iobase-ugh", ParamConstraint(true, DATA_TYPE::VOID, {}, false, { "--iobase-2", "--iobase-8", "--iobase-10", "--iobase-64", "--iobase-uwu" })); nupp.RegisterDescription("--version", "Will supply the version of ghettocrypt used."); nupp.RegisterConstraint("--version", ParamConstraint(true, DATA_TYPE::VOID, {}, false, {})); diff --git a/GhettoCryptCLI/GhettoCryptCLI.vcxproj b/GhettoCryptCLI/GhettoCryptCLI.vcxproj index db19dbe..b92c7bb 100644 --- a/GhettoCryptCLI/GhettoCryptCLI.vcxproj +++ b/GhettoCryptCLI/GhettoCryptCLI.vcxproj @@ -142,6 +142,7 @@ + @@ -150,9 +151,11 @@ + + diff --git a/GhettoCryptCLI/GhettoCryptCLI.vcxproj.filters b/GhettoCryptCLI/GhettoCryptCLI.vcxproj.filters index ffe2192..a704c7e 100644 --- a/GhettoCryptCLI/GhettoCryptCLI.vcxproj.filters +++ b/GhettoCryptCLI/GhettoCryptCLI.vcxproj.filters @@ -24,6 +24,9 @@ Quelldateien + + Quelldateien + @@ -41,5 +44,11 @@ Headerdateien + + Headerdateien + + + Headerdateien + \ No newline at end of file diff --git a/GhettoCryptCLI/StringTools.cpp b/GhettoCryptCLI/StringTools.cpp new file mode 100644 index 0000000..035587e --- /dev/null +++ b/GhettoCryptCLI/StringTools.cpp @@ -0,0 +1,134 @@ +#include "StringTools.h" +#include + +std::string StringTools::Replace(const std::string& str, const char find, const std::string& subst) { + std::stringstream ss; + + for (std::size_t i = 0; i < str.length(); i++) + { + if (str[i] != find) + ss << str[i]; + else + ss << subst; + } + + return ss.str(); +} + +std::string StringTools::Replace(const std::string& str, const std::string& find, const std::string& subst) { + if (find.length() == 0) + return str; + + std::stringstream ss; + + std::size_t posFound = 0; + std::size_t lastFound = 0; + + while (posFound != std::string::npos) + { + lastFound = posFound; + posFound = str.find(find, posFound); + + if (posFound != std::string::npos) + { + ss << str.substr(lastFound, posFound - lastFound) << subst; + posFound += find.length(); + } + else + { + ss << str.substr(lastFound, (str.length()) - lastFound); + } + } + + return ss.str(); +} + +std::string StringTools::Replace(const std::string& str, const char find, const char subst) { + std::stringstream ss; + ss << subst; + + return Replace(str, find, ss.str()); +} + +std::string StringTools::Replace(const std::string& str, const std::string& find, const char subst) { + std::stringstream ss; + ss << subst; + + return Replace(str, find, ss.str()); +} + +std::string StringTools::Lower(const std::string& str) { + std::stringstream ss; + + for (std::size_t i = 0; i < str.size(); i++) + { + const char c = str[i]; + + // Quick-accept: regular letters + if ((c >= 'A') && (c <= 'Z')) + ss << (char)(c | 32); + + // Else: keep the character as is + else ss << c; + } + + return ss.str(); +} + +std::string StringTools::Upper(const std::string& str) { + std::stringstream ss; + + for (std::size_t i = 0; i < str.size(); i++) + { + const char c = str[i]; + + // Quick-accept: regular letters + if ((c >= 'a') && (c <= 'z')) + ss << (char)(c & ~32); + + // Else: keep the character as is + else ss << c; + } + + return ss.str(); +} + +std::vector StringTools::Split(const std::string& str, const std::string& seperator) { + std::vector toRet; + + // Quick-accept: str length is 0 + if (str.length() == 0) + toRet.push_back(""); + + // Quick-accept: seperator length is 0 + else if (seperator.length() == 0) { + for (const char c : str) + toRet.push_back(std::string(&c, (&c) + 1)); + } + + else { + std::size_t idx = 0; + while (idx != std::string::npos) { + std::size_t lastIdx = idx; + idx = str.find(seperator, idx); + + // Grab our substring until the next finding of sep + if (idx != std::string::npos) { + toRet.push_back(str.substr( + lastIdx, + idx - lastIdx + )); + + idx += seperator.length(); + } + // No more seperator found. Grab the rest until the end of the string + else { + toRet.push_back(str.substr( + lastIdx + )); + } + } + } + + return toRet; +} diff --git a/GhettoCryptCLI/StringTools.h b/GhettoCryptCLI/StringTools.h new file mode 100644 index 0000000..4ea42ee --- /dev/null +++ b/GhettoCryptCLI/StringTools.h @@ -0,0 +1,37 @@ +#ifndef STRINGTOOLS_STRINGTOOLS_H +#define STRINGTOOLS_STRINGTOOLS_H + +#include +#include + +/* Handy utensils to manipulate strings */ +class StringTools +{ +public: + //! Will replace every occurence of `find` in `str` by `subst`. + static std::string Replace(const std::string& str, const char find, const std::string& subst); + + //! Will replace every occurence of `find` in `str` by `subst`. + static std::string Replace(const std::string& str, const std::string& find, const std::string& subst); + + //! Will replace every occurence of `find` in `str` by `subst`. + static std::string Replace(const std::string& str, const char find, const char subst); + + //! Will replace every occurence of `find` in `str` by `subst`. + static std::string Replace(const std::string& str, const std::string& find, const char subst); + + //! Will make a string all-lowercase. + static std::string Lower(const std::string& str); + + //! Will make a string all-uppercase. + static std::string Upper(const std::string& str); + + //! Will split a string by a string seperator + static std::vector Split(const std::string& str, const std::string& seperator); + +private: + // No instanciation! >:( + StringTools(); +}; + +#endif //STRINGTOOLS_STRINGTOOLS_H diff --git a/GhettoCryptCLI/Version.h b/GhettoCryptCLI/Version.h index 1420854..c86d6e3 100644 --- a/GhettoCryptCLI/Version.h +++ b/GhettoCryptCLI/Version.h @@ -1,2 +1,2 @@ #pragma once -#define GHETTOCRYPTCLI_VERSION 0.122 +#define GHETTOCRYPTCLI_VERSION 0.123 diff --git a/GhettoCryptCLI/main.cpp b/GhettoCryptCLI/main.cpp index 51ef44d..67760b6 100644 --- a/GhettoCryptCLI/main.cpp +++ b/GhettoCryptCLI/main.cpp @@ -12,6 +12,7 @@ #include "Bases.h" #include "BaseConversion.h" +#include "StringTools.h" // Required for hidden password input #if defined _WIN32 || defined _WIN64 @@ -24,14 +25,13 @@ using namespace GhettoCipher; namespace { - template - inline std::string Hex2CustomBase(const std::string& hex, const T_CONTAINER& customSet, const std::string& seperator = "") + inline std::string Bin2CustomBase(const std::string& bin, const std::vector& customSet, const std::string& seperator = "") { std::stringstream ss; // Translate to custom set - const T_CONTAINER vec_base_custom = - Leonetienne::GeneralUtility::BaseConversion::BaseX_2_Y(hex, BASE_16, customSet); + const std::vector vec_base_custom = + Leonetienne::GeneralUtility::BaseConversion::BaseX_2_Y>(bin, "01", customSet); // Convert to string for (std::size_t i = 0; i < vec_base_custom.size(); i++) @@ -44,6 +44,32 @@ namespace { return ss.str(); } + + inline std::string CustomBase2Bin(const std::string& in, const std::vector& customSet, const std::string& seperator = "") + { + // Split input into symbols + const std::vector in_symbols = StringTools::Split(in, seperator); + + // Translate to binary + std::string binary = + Leonetienne::GeneralUtility::BaseConversion::BaseX_2_Y, std::string>(in_symbols, customSet, std::string("01")); + + // Apply padding to be a multiple of BLOCK_SIZE + // Count how many bits we need + std::size_t required_size = 0; + while (required_size < binary.length()) + required_size += BLOCK_SIZE; + + // Create a string of that many zeroes + std::string padding = ""; + for (std::size_t i = binary.length(); i < required_size; i++) + padding += "0"; + + // Prepend it to our bitstring + binary = padding + binary; + + return binary; + } } //! Will prompt a user password from stdin, hiding the input @@ -142,9 +168,46 @@ const Flexblock GetInputText(bool encryptionMode) // Encryption mode: We want to return the text as-is, as bits if (encryptionMode) return StringToBits(CommandlineInterface::Get()["--intext"].GetString()); - // Decryption mode: We need to first convert hexstring to bitstring + + // Decryption mode: We need to first convert our input to a bitstring else - return HexstringToBits(CommandlineInterface::Get()["--intext"].GetString()); + { + const std::string userInput = CommandlineInterface::Get()["--intext"].GetString(); + + // Are we using iobase 2? + if (CommandlineInterface::Get().HasParam("--iobase-2")) + // Yes: convert to binary from base 2 + return CustomBase2Bin(userInput, BASE_2); + + // Are we using iobase 8? + else if (CommandlineInterface::Get().HasParam("--iobase-8")) + // Yes: convert to binary from base 8 + return CustomBase2Bin(userInput, BASE_8); + + // Are we using iobase 10? + else if (CommandlineInterface::Get().HasParam("--iobase-10")) + // Yes: convert to binary from base 10 + return CustomBase2Bin(userInput, BASE_10); + + // Are we using iobase 64? + else if (CommandlineInterface::Get().HasParam("--iobase-64")) + // Yes: convert to binary from base 64 + return CustomBase2Bin(userInput, BASE_64); + + // Are we using iobase uwu? + else if (CommandlineInterface::Get().HasParam("--iobase-uwu")) + // Yes: convert to binary from base uwu + return CustomBase2Bin(userInput, BASE_UWU, " "); + + // Are we using iobase emoji? + else if (CommandlineInterface::Get().HasParam("--iobase-ugh")) + // Yes: convert to binary from base ugh + return CustomBase2Bin(userInput, BASE_UGH, " "); + + // Else, no special output format specified, use hex + else + return HexstringToBits(userInput); + } // Case: Read from file @@ -218,45 +281,50 @@ int main(int argc, char** argv) // Else: we are just dealing with a string else { - // Output to stdout as a hexstring if (shouldEncrypt) { - - const std::string hexString = BitsToHexstring(output); - + // We are decrypting: + // Output to stdout as a formatted bytestring std::string formattedCiphertext; // Are we using iobase 2? if (CommandlineInterface::Get().HasParam("--iobase-2")) // Yes: convert hex to base 2 - formattedCiphertext = Hex2CustomBase(hexString, BASE_2); + formattedCiphertext = Bin2CustomBase(output, BASE_2); + + // Are we using iobase 8? + else if (CommandlineInterface::Get().HasParam("--iobase-8")) + // Yes: convert binary to base 8 + formattedCiphertext = Bin2CustomBase(output, BASE_8); // Are we using iobase 10? else if (CommandlineInterface::Get().HasParam("--iobase-10")) - // Yes: convert hex to base 10 - formattedCiphertext = Hex2CustomBase(hexString, BASE_10); + // Yes: convert binary to base 10 + formattedCiphertext = Bin2CustomBase(output, BASE_10); // Are we using iobase 64? else if (CommandlineInterface::Get().HasParam("--iobase-64")) - // Yes: convert hex to base 64 - formattedCiphertext = Hex2CustomBase(hexString, BASE_64); + // Yes: convert binary to base 64 + formattedCiphertext = Bin2CustomBase(output, BASE_64); // Are we using iobase uwu? else if (CommandlineInterface::Get().HasParam("--iobase-uwu")) - // Yes: convert hex to base 64 - formattedCiphertext = Hex2CustomBase>(hexString, BASE_UWU, " "); + // Yes: convert binary to base 64 + formattedCiphertext = Bin2CustomBase(output, BASE_UWU, " "); - // Are we using iobase emoji? - else if (CommandlineInterface::Get().HasParam("--iobase-emoji")) - // Yes: convert hex to base 64 - formattedCiphertext = Hex2CustomBase>(hexString, BASE_EMOJI); + // Are we using iobase ugh? + else if (CommandlineInterface::Get().HasParam("--iobase-ugh")) + // Yes: convert binary to base 64 + formattedCiphertext = Bin2CustomBase(output, BASE_UGH, " "); // Else, no special output format specified, use hex else - formattedCiphertext = hexString; + formattedCiphertext = BitsToHexstring(output); std::cout << formattedCiphertext << std::endl; } else { + // We are just decrypting: + // Just print it string-formatted std::cout << BitsToString(output) << std::endl; } }