How to store secure information in a data file [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
In my server-client program I want to know if the client is official (so, not modified). For that I want to implement a version check and the version should be stored in a data file or something. The problem is, how to store this securely? I don't want it to be readable with any sort of text reader, and if someone would modify the client, it must still not be usable for the modified program.
I already tried several things, like using a Data In/Out Stream, or an Object In/Out Stream, but they all remain slightly visible in a program like Notepad++, and still they can be used by any non-authentic version of the client.
Is there a way to do this properly?

Don't rely on a "version check" in this sense. Instead, use signed jars, which guarantees the jar cannot be modified and still run, and use the signature field in the manifest file in communications with your server to determine if the client is an authorized version.
http://docs.oracle.com/javase/tutorial/deployment/jar/signindex.html

Related

Download and read web source code, illegal? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am working on a project which generates a meaningful url, connects to it, and download its HTML source code. The program will further read the source and extracts useful info from it. Is this illegal?
By itself, there is nothing illegal happening from what you've described. But you're being very vague.
What do you mean by "generates a meaningful url"? Generates how? What determines "meaningful"?
Downloading the html given by the server at the requested url is exactly what a browser does. Nothing odd there. Browsers also read that html and build a document from it to display to a user.
What do you mean by "extracts useful info from it"?
What do you do with the resulting info?
Are you bypassing any security, or spamming the same server with massive numbers of requests? Are you doing anything that violates someone's privacy? Are you reposting any of the information you gathered without referring back to its original source?
What is it about your project that is even raising a red flag in your mind about legality?
These are the sorts of questions you should be asking yourself.
If this is for a personal project, then no it is not illegal in the least. If this is for a commercial product, however, I would err on the side of respecting any copyrighted content on the webpage.

Perl's thaw() implementation in Java [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have two applications running concurrently: one in Perl, and one in Java. The Perl app relies on using nfreeze to store objects in the database. If my Java app has access to that database, how can I "thaw" that object inside of the Java application?
I don't need to be able to write to that object, just read it and use it in the Java app.
Storable is specifically designed for Perl data structures. It hasn't been ported to other languages.
Instead of (or in addition to) using Storable, use XML, JSON or YAML (in no particular order).
It's that's not possible, your Java program is going to have to call a Perl script to translate the data into something more convenient.

Can I run java code in html textbox? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I am writing one web page in which I am putting one html input type="textarea" in which user will write their java code and on submit it will return output of that java code. Can I do this using jsp? if not then what are the other ways.
I would think very carefully before allowing people to do that.
At the very least, to read and run the user's input, you will need a JDK to compile it, and a JVM to run it. Since you're talking about over the web, presumably the user's machine will not have those (otherwise they'd just use theirs), so you'd have to use the ones on your server - that is, take the user's text, upload it as a .java file to your server, compile and run it (for an anonymous user on your server!), and send the result back to the browser session.
As you can see, there are a couple of pretty big, bad security problems here. Not recommended !

How to read/write from/to a drive directly using Win32 API [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Without having to write a low-level Windows driver, but still using either Java or some C-based API, is it possible to read/write from/to a raw, unpartitioned drive... one that has got no file-system on it?
A short sample program would help. If not, at least knowing what standard Windows/Java (or, 3rd Party) API I could use in userspace (without having to write a device driver) would help.
It is possible to access a raw disk using the CreateFile() function by passing
"\\.\PhysicalDriveX"
as name.
Where X is a 0-based index counting the drives.

How to put message into Sent? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
After sending the message with JavaMail by smtp, how to put it into the Sent folder(IMAP)?
What about the non-english mail(ex: in Russian sent=отправленные)? Is there a way to get the name of the "sent" folder programmatically?
Folder.appendMessages()
There's no standard name for the "sent" folder. Depending on the mail client being used, the folder might have a different name. There's an IMAP extension that would tell you which folder is the "sent" folder, but I don't think most servers support the extension.
In general, the Sent Folder doesn't have a fixed name. Gmail, specifically supports 'special use extensions' for Folders. When you do a LIST to get the list of email boxes, it will tag the sent folder with a \Sent tag.
See Gmail's document for their implemented extensions.

Categories

Resources