No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
15 Posted Topics
I have a program that creates a unique key for a database. However I get an error that I am trying to write duplicate data to the database. How can I fix this? Code: private string GenerateScanID() { string scanID; scanID = "SC-" + DateTime.Today.Day + "-" + DateTime.Today.Month + … | |
I am writing a program that reads a fiel and displays the contents in hex values. The problem is that there are some very strange characters in my output. Code: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_BUFFER_LEN 512 typedef enum cbool { ctrue = 1, cfalse = 0 } … | |
Hello, A simple program I am writing uses a struct to store a key and key size variable. However I get an error that states that my struct variable is being used without being initialized... I dont really know why it is telling me that. Code: `keygen.hpp` #include <ctime> #include … ![]() | |
I'm writing a program tha calculates linear regression, one of the values that are generated is the r (linear correlation coefficient) value. However, my algorithm doesnt work. I implemented the r value from the formula located at [Click Here](http://mathbits.com/MathBits/TISection/Statistics2/correlation.htm) Here is my code: long double LinearRegression::calculate_r() { long double r; … | |
I have written a simple message encoded that encodes messages into words of 4 characters each. It generates a key that will later be used to decode the message. The key is a list of numbers. The numbers are the original whitespace positions before the encoding started. The problem: My … | |
Hello. I am was doing research on cryptography and found a simple algorithm (One time pad algorithm) that interests me. I was able to create a simple version of this that only works with capital letters. The problem however is that the encrypted contents doesn't only contain capital letters. It … | |
I need to allocate memory to a pointer variable passed by parameter. #include <stdio.h> #include <stdlib.h> typedef int* PTR_VALUE; int initialize(PTR_VALUE value_array) { value_array = (PTR_VALUE)malloc(sizeof(PTR_VALUE) * 94); return 0; } int main() { PTR_VALUE pValue; initialize(*pValue); printf("%d", pValue); gets(""); return 0; } but I get an error when I … | |
So they dropped ODBC on Java 8. Thats somewhat a problem for me. I searched to find alternatives and UCanAccess is what looks like to be the most popular. But I was wondering if there are alternatives that are better or equal to UCanAccess? | |
I need to get the size of a file, but I keep on getting 0 as the size, which is not the actual size. private void dodAlgorithm() throws IOException { int count; int randomValue; long fileSize; File file = new File(filename); BufferedWriter writer = new BufferedWriter(new FileWriter(file)); SecureRandom random = … | |
I'm working on a server and client program. Data will be exchanged between the server and client. This data will be encrypted. The server will always generate the salt and the IV. The client will receive the salt and IV and use it to encrypt / decrypt the data that … | |
I improved my AES encryption code, I now generate a key from a password of any length. But now I dont know if I'm generating a 128, 192 or 256 bit AES key. Here is my code: import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.Cipher; public class AESCipher … | |
Hello. I'm working on a project that requires some data to be encrypted with AES 128. My encryption works fine but when I decrypt I get an `Exception in thread "main" javax.crypto.IllegalBlockSizeException: Input length not multiple of 16 bytes` exception. Code: import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; public class AESCipher { private … | |
I'm writing some custom encryption code in Java for my server. The only problem is that in my encryption I'm using XOR. The data gets encrypted fine, but when I decrypt it doesn't decrypt correctly. I am not sure what is cuasing this problem. Here is my code that I … | |
Hello everyone, I'm new here - just joined. I'm strugling with a bit of code. Im trying to check if a number is a prime number, but my program produces weird results. Herse the code: { Vefies if a value is prime. } function TMactacHash.IsPrime(value: integer): boolean; var i, overValue: … | |
Re: Well to open command promp you can simply do: [windows key] + R and then type in cmd and click ok. This will open up CMD for you. You say "run my text file", well I'm not sure if you can "run" a text file, but you can open it … |
The End.