Can Java Applets be dangerous? [closed] - java

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 2 years ago.
Improve this question
So I'm currently reading the "Java A Beginners Guide 7th Edition" book. And the following sentences seemed to me that Applets could be used as virusis. Was this done?
An Applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed inside a Java-compatible web browser.
The key feature of applets is that they execute locally...
To me it sounds like it wouldn't be hard to build in a virus into an Applet.

The problem with applets is that they run automatically when you load the page. They're also so complex (compared to html or javascript) it was just to complicated to be able to meaningfully secure them. Run Automatically + Complicated to Secure + Doesn't Update Automatically = impossible to completely secure.
Regular apps are far far more dangerous to your machine than applets were. But, they don't run automatically when you visit a web page.
Desktop apps written in languages (like C or C++) where you manipulate the memory with pointers and don't automatically bounds check arrays, are much harder to write securely. Languages (like Java or C#) that don't have pointers and do automatically bounds check arrays are easier to write secure apps in.
Java includes many safewards to prevent any ill behavior, but time after time, those security features were not enough because of different bugs or design problems.
As standalone apps they are as safe or risky as any other app. Just make sure to download your app from trusted sources.

Related

Linux Deamon in C++ or Java? [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 have a Windows service written by another developer who no longer works with me. It was written in C# with .NET 4.5 requirements. Our solution is making the move to Linux and the daemon naturally needs to be converted.
My dilemma is what to rewrite it in? C++ or Java? The daemon is not complicated. It's simply a controller for our other applications to ensure if they crash or are killed they are restarted. Aside from that it performs health checks through a named pipe and is controlled via a password protected web socket via a separate management Tomcat web interface and writes all of it to logs.
Please put aside any suggestions of "write in what you're most comfortable with" I have a fair amount of experience and knowledge in both languages, and I'll learn whatever else I need to as I go. My concern is the feasibility and effort to accomplish everything I need. I don't have any particular time constraints, but if one language is a fraction of the time of the other then maybe that's a better solution.
Writing it in Java looks like the easiest solution currently, but writing it in C++ has the advantage of being native no-frills code. However, I haven't ever written any web interface or socket code in C++ before, so I do not know the effort involved with that.
To break down my requirements:
Linux
Web interface for control
Named pipe for communicating with client applications
Existing code needs to be heavily refactored
Is C++ or Java more appropriate?
Edit: added more info
Edit2: I guess I should have mentioned that the code needs to be heavily refactored anyways. It was originally written in such a way that renders it difficult to make changes and additions. So rewriting is a cleaner solution at this point. As I mentioned, it's not a large program. Just a controller service.
Porting the solution to .Net Core may the way to go. It will run on Linux (and Mac for all intents and purposes...) and most of your codebase may need minimal refactoring. The only concern is if .Net Core currently has the features you would need supported in the app. And, .Net Core is still in preview.

Web browser applications program language? [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 would like to write various web browser games and apps to post to my own personal website, mostly for fun. I'm pretty familiar with Java and starting to get into C a little. As I understand it, I cant just run a common java application from a web browser but have to use the JApplet class or Applet class(or possibly others.) Can I use a JApplet to make fairly sophisticated games or is it really just for basic display images? I'm willing to learn something completely outside of Java.
I've been browsing the web but am a little overwhelmed in deciding how I should go about this. I would like to make games that are pretty simple graphically, but can remember things like a characters inventory.
Its really just a place to host different games and things I make. How should I go about this?
I hope this isn't too vague.
The only language you can guarantee within a web browser is JavaScript. You can write highly sophisticated games using JavaScript, so this shouldn't be a major problem - you can see an example written using Unreal Engine and JavaScript on YouTube.

How to run java code in HTML [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 have a piece of java code I would like to run in my web browser and publish online. How can I do this without using applets? I have tried java vertx but I am not sure how to use it and there are no good tutorials online.
The short answer is you can't. Browsers don't "speak" Java natively, which is why applets required a plugin. As you probably know, Google is in the process of removing support for the plugin technology used by the Java plugin (NPAPI) and so soon Java won't work in Chrome at all (it already doesn't under Linux).
Your only real options are:
Provide a means of running it server-side, like http://ideone.com and various other "online" compilers do.
Translate it from Java to JavaScript (either manually or using a tool), which the browser can then run. But note that Java and JavaScript are not only markedly different languages despite a superficial similarity in syntax, but the standard environment for each is also quite different from the other.
How you do either of those is much too broad a question for SO.

How to keep a Java program secure from hacking [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 created a Java programm which works on the serverside to communicate with an Android-App over Sockets. Now I want to check wether it is secure to hacking. I also asked in the Security.SE forum but this is programming related. So what do I need to look for in my Java-program to make it heavy to be exploided?
The first thing to check would be the server it's running on. You can cerainly checkout the https://www.owasp.org/ website. It is always a good source of security threats. Then there are a lot of pentesting tools https://www.kali.org/ has many of them built in.
But the most important might be how you've designed your API, I mean you're not very specific about what you need to know but some rules that will certainly apply:
secure the communication
make sure id theft is as hard as possible
never store userpasswords yourself(use a tokenbased system like oauth)
Obfuscation via proguard makes the program harder to reverse engineer.
Obfuscation combined with Ahead-Of-Time Compilation
1) Obfuscate names and encrypt strings using the tools not relying on the application being delivered in bytecode form. Make sure to disable control/data flow obfuscations.
2) Compile the obfuscated application down to optimized native code.
see link
http://www.excelsior-usa.com/articles/java-obfuscators.html

How does Java affect the client-side? [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 9 years ago.
Improve this question
I seem to be confused on a few levels of understanding Java, here is what I am curious about:
Is Java a client-side and server-side language?
Is it more a client-side or server-side, if both are applicable?
I don't know if this is the correct way to put this, if it isn't, please kindly me inform me of where this question would do better.
Thank you so much!
Is Java a client-side and server-side language?
It is a language. It is not specifically client side or server side and it can be used in Blu-ray players and many other devices where there is no client or server.
Is it more a client-side or server-side, if both are applicable?
It is use more widely on the server side.
Why does it perform so poorly either way?
It doesn't perform so poorly. It is less popular on the client as it can require a large download and has suffered some security concerns lately. It also doesn't run on every device whereas Javascript is more widely supported.
JavaScript is a client-side language.
Not true, Javascript can be used in Java and is used on the server side stand alone. see Node.js
Java can be used as either. You can write thick client applications, server applications (web or other), or applets that get embedded in browsers, webstart which is initialized via a browser but launches more like a client-side java application.
Java in the browser is generally a bad idea, there have been many security issues, and, imo (and this is very subjective) it sucks for ui (not the code, but the user experience).
Java has huge market share for server side business applications (web or otherwise) especially in the enterprise space.
Java doesn't perform poorly at all. It often performs on par with compiled code (such as C++). The only challenge with Java is that because it is cross-plaform it will sometimes be challenging to work with platform specific things (e.g. directx).
There is a big difference between Java and Javascript.
You might want to look up both.
Javascript is mostly used as client-side language, and Java is most used for applications and or websites.
It's unclear what you mean with poorly performance, you might want to update your question for that part.

Categories

Resources