Tag Archives: Java

Signing Contents Digitally: An Email Implementation

“I was happy when I design my own signature. Also, deciding to put my signature under this job makes me happier. Characteristic of signatures transforms in time. However, it would be remain same in a day. Letters takes the form of yourself, they makes your name official on a paper”. That’s the cover text of Turkish Singer Sila‘s album named as signature.

Handwritten signatures proves identity of signer on a marked document. Characteristics of letter formation are unique for every person like finger prints. Also, one’s fine motor skills might affect his handwriting. This leaves clues about signatory’s idendity. So, signatures can be verified by Questioned document examination.

Digital signatures are like handwriten signatures. They demonstrates authenticity of digital content and they can be verified too.

Digital signatures include two different cryptography concepts: cryptographic hash functions and public key cryptography.

new-york-one-way-1024x768

Hash functions are one way irreversible functions

Continue reading

Exchanging Encrypted Mails

2016 released Snowden is a biographical movie fictionalised life story of Former NSA employee Edward Snowden. The movie reveals illegal surveillance techniques of the government organization. Also, harversting email and search history data is revealed by Snowden, too. This paranoia might convince Zuckerberg. He covered his webcam and mic with tape.

Beyond the paranoia, doubt often forces more rigorous scientific analysis and leads discoveries. In other words, thoroughly conscious ignorance. So, we can protect mails even if they are harvested by third parties. In this post, we will mention an implementation of exchanging encrypted mails.

We will build an exchanging encrypted mail implementation, and run it via gmail infrastructure. In order to work on gmail, you need to allow less secure applications to access your gmail account. You should skip this step if you work on an alternative mail server. Also, we would develop this implementation by referencing Java Mail API.

Continue reading

Protecting Java Codes: Encrypted Class Loader

Cloud services are adopted by both start-ups and enterprises in recent years. However, it comes security issues. At this point, developed codes differ from the data. Critical data should be stored as encrypted. On the other hand, developed codes are mostly installed on server vulnerably. For istance, Java projects could be installed on a server as a jar/ear extention file. This files include java classes hierarchically. However, there are several decompilers extract original java codes from class files.

What if the developed code includes patentable algorithm? An enterprise might protect its intellectual property. In this case, installing the project on a server directly would be like turkeys voting for Christmas. So, what we are saying is that we should encrypt the important codes just as critical data, store them in cloud database, and decrypt it on runtime to protect intellectual property. In this way, custom codes would be still secure even if the cloud system is invaded because encryption key would not be stored on cloud system.

Continue reading

Small is Beautiful: working with short URLs

Today’s world limits our expressions lenght to 140 character. No matter you text SMS or Tweet, you have to fit your sentences based on this restriction. Further to that, nobody has toleration for longer statements. That’s why, text material should be picked and chosen. Herein, some subsdiary materials such as long links would cause to go waste. To sum up, small is beautiful.

blowfish

Blowfish Represents Long Urls in Bitly Icon

URL shortening services redirect long urls to shorter one. This kind of urls are friendly for messaging technologies requiring limited number of characters such as sms. Thus, you can append a link into your message and message quota would not be exceeded. Moreover, short urls are memorable. That’s why, referencig short urls are common in hard copied paragraphs such as newspapers or magazines.

Formely, Twitter automatically shortens links with Bitly service, this makes Bitly popular. Today, The Blue Bird consumes their own t.co service.

What’s more, Bitly and Google are the most common url shortening service providers for end users. Although, web inteface of these service providers are easy to consume, urls should be shorten manuelly. In this post, we will focus on how to consume these services in our programs.

Continue reading

Working on Trained Neural Networks in Weka

Applying neural networks could be divided into two phases as learning and forecasting. Learning phase has high cost whereas forecasting phase produces results very quickly. Epoch value (aka training time), network structure and historical data size specify the cost of learning phase. Normally, the larger epoch produces the better results. However, increment of epoch value will cause to be taken longer time. That’s why, picking up very large epoch value would not be applicable for online transaction if learning is implemented instantly.

However, we can apply learning and forecasting steps asynchronously. We would perform neural network learning as batch application (e.g. periodic day-end or month-end calculation). Thus, epoch would be picked up as very large value. Besides, weights of neural networks will be calculated on low system load (most probably late night hours). In this way, no matter how long neural networks learning lasts. Thus, we can even make forecasts for online transactions in milliseconds. You might imagine this approach like that human nervous system updates its own weights while sleeping.

snoozing-superhero

Even Superheroes Need to Rest

Continue reading

Building Neural Networks with Weka In Java

Building neural networks models and implementing learning consist of lots of math this might be boring. Herein, some tools help researchers to build network easily. Thus, a researcher who knows the basic concept of neural networks can build a model without applying any math formula.

So, Weka is one of the most common machine learning tool for machine learning studies. It is a java-based API developed by Waikato University, New Zealand. Weka is an acronym for Waikato Environment for Knowledge Analysis. Actually, name of the tool is a funny word play because weka is a bird species endemic to New Zealand. Thus, researchers can introduce an endemic bird to world wide.

Continue reading

Backpropagation Implementation: Neural Networks Learning From Theory To Action

We’ve focused on the math behind neural networks learning and proof of the backpropagation algorithm. Let’s face it, mathematical background of the algorihm is complex. Implementation might make the discipline easier to be figured out.

Now, it’s implementation time. We would transform extracted formulas into the code. I would prefer to impelement the core algorithm in Java. This post would also be a tutorial of the neural network project that I’ve already shared on my GitHub profile. You might play around the code before reading this post.

neural-networks-3

Non-linear sinus wave is chosen as dataset. The same dataset is used in the time-series post. Thus, we’ll be able to compare the prospective forecasts for both neural network and time series approaches. Basically, a random point in the wave would be predicted based on previous known points.

Continue reading