Java xor Decoder [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
We have found files encoded using XOR Encryption, but Im newbie on JAVA, please how to decrypt XOR using this xor encoder.

The code is generating a random int (4 bytes) and using it to XOR the input - it is not asking for the encryption key, it is generating it randomly. Unless the receiver has some way of knowing what the next random int is, it will not be able to decode. EG, perhaps the sender and receiver are expected to initialize their random generators with the same seed value when they start up. Regardless, it is not a real encryption algorithm, just another example of some half-cocked idea someone invented in their head. You really need to replace this code with a correct usage of encryption.

Related

How to generate the same random numbers in one language as in another? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am translating codes from Stata to R. The same random seed does not generate the same outputs. I am not sure if this is also the case in other languages (Python, Java etc.). How to generate identical random numbers in different languages?
R uses its own initialization method for the Mersenne-Twister (see help("set.seed")), which differs from what other languages do. The easiest way to ensure the same PRNG is used (and to avoid implementing something subpar yourself), is simply interfacing R and Stata and using the PRNG from either of these.
However, it's worth keeping in mind that achieving true reproducibility is impossible unless you are using exactly the same software on exactly the same hardware and OS. Thus, I wouldn't spent effort on trying to achieve the same PRNG streams with different software. Instead I would generate these numbers, store them and import them as needed.

Change tag 31 in Fix4.4 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am using FIX protocol and I need tag 31 to be of string type.
Originally it is of type price which means a float or double.
I was just wondering if it will have issues(currently i don't see any issues)
Thanks in advance.
Assuming you are using QuickFIX/J, you only tagged fix-protocol and java.
Since the data is transmitted over the wire as Strings anyway you won't have issues with your counterparty.
The only issue that might occur is that when receiving messages you need to make sure that your data dictionary and your code both process the field correctly. You cannot be sure that the received value in the field will be of type "price" anymore. Your counterparty could now send any String value in the field which could make your code fail.
But in general every value is converted to String internally anyway.

Need to Specifically Learn Scheme Knowing Java and Python [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I would like to read SICP but I don't want to fully learn Scheme. I know Java, C#, and Python all very well, so would it be possible to pick up Scheme quickly while still getting the full value out of the book?
Yes. Just read it, the code is very simple.
(f a b c) means f(a,b,c), and (define (f a b c) ...) means f(a,b,c) { ... }. And, the values, not variables, have types (variables instead are generic pointers to values). That's all. :)
So just by reading the book you'll be able to pick up the Scheme as used in it -- this was the expressed intent of the authors, too.
After reading some, or even before, watch the videos from the 80s. It's great stuff.

Very simple explanation for using FFT to find audio frequency changes [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm having trouble understanding the concept of using FFT to calculate frequency changes. I've been scavenging through a ton of articles on this concept but it's still confusing me. I found a Stack Overflow article about the steps to take to calculate the frequency, but I'm still a little bit confused on exactly what to do in Java.
Sounds like you need to start way back with some general concepts. An FFT is just a fast DFT. A DFT uses Fourier decomposition on a set of sampled data. So first you need to understand what a waveform is, what a sinusoid is, what a frequency is (and is not the same as a musical pitch), and how Fourier's theorem works to relate the two. Then how to compute a DFT on a window of a sampled waveform, and how to interpret the complex result vector. Then how to do it fast in Java.

Eclipse password storage [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am currently learning Java and am starting to use file IO. For a random personal project, I would like a user to create an "account" with a password. I would like to store the information for later, but I would like to have a way to encrypt the password (something even very basic would work for now).
Any tips are much appreciated.
Thanks.
This is where something called Hashing comes in handy. Hash functions work by creating a hash key (integer value) from the original string using a function. The benefit of this is that you can check that a password is correct by checking whether the entered password is the same as the stored hash key, without actually knowing the password.
Creating your own hash function is something you wouldn't normally be expected to do as there are secure hash functions available. Although you may want to play around with them for fun.

Categories

Resources