Posts

Showing posts with the label kotin

Kotlin - RSA + AES a double layer security system

Image
 Hello everyone, Today we will learn a double layer security system using RSA+AES, with the help of architecture visualization and one Kotlin example. Encryption's primary purpose is to protect against brute force attacks. It is composed of a cipher, the message/data, and a key (the password). With a wide range of free tools available like(Aircrack-ng, John the Ripper, Rainbow Crack, L0phtCrack ), even baby hackers can attempt to hack passwords using brute force. In my opinion, as a layperson in cryptography, multiple double-layer encryptions may not increase security, but it may slow down attackers. Using encryption may cause performance issues. Or maybe not. It really depends on how you use it. If you understand just how "expensive" each part of your enterprise encryption operation is, it's possible you can avoid the expensive parts and dramatically increase the performance of your applications. Let's see the architecture of the RSA + AES system This is the top

Iterate over the Map, List, and Set in Kotlin!How?

Hello everyone, Today we will learn how to operate over Map, List, and Set in Kotlin. In Kotlin, we can loop a Map in the following ways: 1. Using for loop 2. Using forEach 3. Using Iterator Example: fun main(args : Array<String>) { val items = HashMap<String, String>() items[ "1" ] = "JAVA" items[ "2" ] = "KOTLIN" items[ "3" ] = "GO" items[ "3" ] = "PYTHON" //for loop example println ( " \n -- Example 1.1 -- " ); for ((k, v) in items) { println ( " $ k = $ v " ) } // forEach example println ( " \n -- Example 1.2 --" ); items. forEach { (k, v) -> println ( " $ k = $ v " ) } //Iterator example println ( " \n -- Example 1.3 --" ); val itr = items. keys .iterator() while (itr.hasNext()) { val key = itr.next() val value = items[key] print

WebSocket + Kotlin + Spring boot simple application example

Image
Hello everyone, Today we will learn how to develop a Simple Kotlin - Spring Boot - WebSocket, chat application. Why WebSocket? We already know traditional HTTP requests are unidirectional and heavy. But WebSocket is bi-directional. The initial connection is using HTTP, then this connection gets upgraded to a socket-based connection. This single connection is then used for all future communication. The WebSocket message data exchange is much lighter compared to HTTP. Project Directory: Pom.xml[maven] <? xml version ="1.0" encoding ="UTF-8" ?> < project xmlns ="http://maven.apache.org/POM/4.0.0" xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance" xsi :schemaLocation ="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" > < modelVersion > 4.0.0 </ modelVersion > < parent > < groupId > org.springframework.boot </ groupId > < artifactId > spr