[Solved] How can I decode an NSString using the A1Z26 cipher? [closed]

In Objective C this can be done as follows: -(NSString *)decode:(NSString *)input { NSArray<NSString *> *components = [input componentsSeparatedByString:@”-“]; NSMutableString *output = [[NSMutableString alloc] init]; for (NSString *component in components) { if (component.length == 0) { continue; } char charValue = (char) [component intValue]; [output appendFormat:@”%c”, charValue + (‘a’ – 1)]; } return [NSString stringWithString:output]; … Read more

[Solved] C++ : Mini Project on Cryptography

There is a quite simple answer to how to encrypt files. This script uses the XOR encryption to encrypt files. Encrypt the file a second time to decrypt it. #include <iostream> #include <fstream> #include <string> using namespace std; void encrypt (string &key,string &data){ float percent; for (int i = 0;i < data.size();i++){ percent = (100*i)/key.size(); … Read more

[Solved] What encryption type is this? [closed]

It seems the text is encrypted with the NULL encryption algorithm described in RFC 2410. If I run it through the accompanying decryption algorithm, it decrypts properly without error and gives the following plain text: OH0fRX0gOHZgOH0tOH4fRX8tOr0gOHZgOH0tOH4fOrZgOH0fRX8tOH4gOHZgOH0tOr4gRX8tOr4fRX0gOHZfOH4fRX4fOr0tOrZgOr4tObZgRX4fOr4tOrZeRX4fOrZfRX0fOH4tOH0gRX0fRX0fOrZeRX4gOH4tOr4gRX0gOr4tOH0fOrZfOH4fRX4tOr0fOH4gRX8tOr4fRX4fOHZgOr4fRX0gRX4fRX0tObZgRX4fOr4tOrZeRX4fOH4tOr0fOrZfOHZgOH4tObZgOr4fRX4tOr0fOrZgOH0tOr0gRX8tOHZgOH0tObZgOr0fRX4gOr4tOr0tOr4tOH0tObZgOr0gRX0gOHZfOr0tOr0fRX8tOr0gOrZgOH0tOr4tOH4tOHZfOr4tOr0fOH4gRX4gOr0fOrZfOH4gOr4tOr4gOrZfOH4fRX4gRX0gOrZgOH0fOr4tObZgOrZgOr0fRX4gOr4tOH4fOr4gRX0fOH4tOr0fRX4gOH0tOr4gOrZgOr4fOr0tOH0gOr4tOH0gOH0tOr4fOH0tOH0gOr4tOr0fOH4fRX4gOr0fOrZfOr0fRX4gOr4tOr0tOH0fRX4fOr0gRX4gOr0fOrZgOr4fOr0tOH4fOr4gRX0fOr4fOHZgOr4fOr0tOH4fOr4gRX4gOr0fOrZgRX4gOHZgOr4tOr4fRX0fOH0tOr4tOH4fOrZfOr4gOHZgOr4fRX4fOr0gRX4gOH0tOr0gOrZfOrZfOr4tOH4fOrZgOH4fRX0fOr4tOr4fOH0tOr4gRX0gOrZgOr0fRX4fOH0gRX0gOH0fRX0gOr0tOH4fRX0 The plain text does not make much sense to me, however. But that’s the fundamental problem with data: There … Read more

[Solved] Print all possible combinations, given a specific number format [closed]

Try this: with open(‘file.out’, ‘w’) as output: for n in xrange(100000000): s = “{0:08d}”.format(n) output.write(s[:2] + ‘-‘ + s[2:] + ‘\n’) … But be aware that that’s a lot of combinations, it’s possible that you’ll run out of memory, and if not anyway the resulting file will be huge and the program will take a … Read more

[Solved] Encrypting the password using salt in c# [closed]

(As suggested, I’ve replaced my previous salt generation method with something that should be more secure) To generate a random salt: public static string GenerateRandomSalt(RNGCryptoServiceProvider rng, int size) { var bytes = new Byte[size]; rng.GetBytes(bytes); return Convert.ToBase64String(bytes); } var rng = new RNGCryptoServiceProvider(); var salt1 = GenerateRandomSalt(rng, 16); var salt2 = GenerateRandomSalt(rng, 16); // etc. … Read more

[Solved] A book that contains, Shor’s algorithm, McEliece cryptosystem, Lattice-based cryptography, Discrete logarithm [closed]

There is “Post-Quantum Cryptography” published by Daniel J. Bernstein. The book is more of a general overview and doesn’t go that far into details. It contains sections about lattice based, hash based and code based cryptography. Shor’s algorithm as well as discrete logarithm aren’t handled in depth, but there is a general overview. I think … Read more