Posts

Showing posts with the label kotin

Build REST CRUD API's with Kotlin, Spring, and MongoDB

Image
In this article, we will show you how to develop a  REST-style web service with Kotlin, Spring Boot, MongoDB. A quick overview of Kotlin, Spring Boot, and MongoDB    Kotlin: It’s a modern programming language targeting the Java platform. Kotlin is concise, safe, pragmatic, and fixated on interoperability with Java code. It can be used virtually everywhere Java is utilized today: for server-side development, Android apps, and much more. Kotlin works great with all subsisting Java libraries and frameworks and runs with the same level of performance as Java.   MongoDB: MongoDB is a document database built on a scale-out architecture that has to propagate with developers of all kinds who are building scalable applications utilizing agile methodologies. MongoDB was built for people who are building internet and business applications who need to evolve expeditiously and scale elegantly. If you are doing that, you should consider MongoDB. Companies and development teams of all sizes use Mongo

Kotlin- RSA, AES, 3DES Encryption and Decryption with example

Image
Quick Overview - RSA The RSA algorithm (Rivest-Shamir-Adleman) is a cryptographic algorithm that is used for specific security services or purposes, which enables public-key encryption and is widely used to secure sensitive data, particularly when it is being sent over an insecure network such as the HTTP. A public key is shared publicly, while a private key is secret and must not be shared with anyone. The following illustration highlights how asymmetric cryptography works: Example 1 :  RSA Encryption and Decryption The Cipher Type: RSA/ECB/PKCS1Padding import java.security.spec.PKCS8EncodedKeySpec import javax.crypto.Cipher import java.security.spec.X509EncodedKeySpec import java.io.IOException import java.security.* import java.util.* class RSADemo { var privateKey: PrivateKey var publicKey: PublicKey companion object { // convert String publickey to Key object @Throws (GeneralSecurityException:: class , IOException:: class ) fun loadP