Category: Java

0

Using “pepper” to increase password storing security

In a previous article I wrote how to securely store a password in the database. The article got the attention of many fellow developers and so I decided to improve it even more by writing this article. You see, even though it is very secure to store the password as a salted hash, there is an additional layer of security that can be added in order to make things even harder to crack: pepper. The “pepper” part is not meant...

0

Using JSON Web Tokens for Authorization

A useful feature of a web application is the possibility to authorize a client to access certain features of the app. Once authentication happens, it is important to also check that a client has access to the requested feature. An easy to use method is provided by a JSON Web Token. These can be easily generated, can hold the data needed for authorization, and most importantly, are secure. Let us look at how a JWT is generated by the server...

0

Keep your code well organized. How I structure my web project

It is easy to get carried away and just write code. The code may even work as intended but trust me that, in 6 months time, you won’t know anymore what it does and where to find a specific functionality. Unless you have a clean and clear structure. I am not necessarily talking about the classes itself, but the way to properly organize functionalities in packages so that, when a change is needed 6 or 12 month later, you know...

2

Designing and Coding Event Management in Java

A few years ago, back when ActionScript 3 was still used, but barely, I wanted to try game development in Java. All major game engines use other programming languages like C#, C++ or Lua, so it was a real pain to get started. That is when I discovered LibGDX, a graphics library for Java. The downside is that LibGDX is not very friendly for beginners and for someone that used to do game dev in ActionScript 3, it was a...

2

Building a form in Play Framework

Play Framework has some very useful utilities and helpers for generating forms. In this simple tutorial I will be showing how to build a form in Play Framework in Java, how to validate the input and display any validation errors.

0

How to properly store a password in the Database

When I started LOGaritmical, one of the first functionalities that I implemented was registering a new user. This meant that I had to store the user’s password in the database in a secure way and I will need to be able to verify that the password entered during login is correct. This is something that is quite easy to implement incorrectly and you would be surprised (or not) at how many systems and websites store passwords in an incorrect way....

1

Simple Collection Manipulation in Java Using Lambdas

Using the power of Streams in Java 8 and with the help of Lambda Expressions we can do easy, fast and reliable manipulations on Collections. We can easily filter or sort lists as well as other operations, regardless of the overall complexity.

string-uuid-hibernate-mysql 3

How to use String UUID in Hibernate with MySQL

Using a unique ID for columns in a table is important. Besides the auto-increment option, we can use the Java UUID column, however, if we want it to be human-readable we need to store it in a VARCHAR column. This can be easily done using the @Type annotation in Hibernate