Spring-boot Docker example
This is Spring-boot tomcat docker example,
docker build -t vinston/spring-boot-tomcat .
docker run -P -d --name spring-boot-tomcat vinston/spring-boot-tomcat
- Play 2.4’s AES encryption now uses initialization vectors to randomize each encryption.
- The Play encryption format has been changed to add support for initialization vectors.
You can also:
- Download and Use the GitHub project for your learning purpose
- Refer Play2 Site for more info: Play2 Crypto
Play2 Built-in Java Cryptographic Example uses a number of open source projects to work properly:
- Play Framework - Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture
- [AngularJS] - HTML enhanced for web apps!
- [node.js] - evented I/O for the backend
- [Gulp] - the streaming build system
This example required the following tools to run
- Play Framework v2.4+ to run.
- SBT vsbt-0.12+ to run.
- Node.js v4+ to run.
Install the dependencies and devDependencies and start the server.
$ mkdir examples
$ cd examples
$ git clone ssh://git@github.com/vinstonpandiyan/scalaplay2aesexample.git
$ cd scalaplay2aesexample
$ sbt run
$ cd examples/app/website
$ npm install -d
$ node app
For using the play2 we need to generate the private key. Use and run the following steps to create the private key and copy paste the play2 application.conf file
- Ex: play.crypto.secret="jhc_GPt:=uhJJYjEI00`5RkoB9C6kotmqb3iM9CVE]9jq:3t]>oOK2;MSzxmg?Uy"
$ sbt playGenerateSecret
OR
$ sbt play-generate-secret
For production environments...
$ npm install --production
$ npm run predeploy
$ NODE_ENV=production node app
Use IntelliJ scala editor tool to develop the application, it is sweet and elagant way of development friendly tool.
- Use Git to download the project
- And use Scala Play SBT plugin to run the project
- To Encrypt the text using play2 - http://127.0.0.1:9000/app/play/encrypt?text=TEST_TEXT
- To Decrypt the text using play2 - http://127.0.0.1:9000/app/play/decrypt?text=
- To Encrypt the text using custom AES - http://127.0.0.1:9000/app/aes/encrypt?text=TEST_TEXT
- To Decrypt the text using custom AES - http://127.0.0.1:9000/app/aes/decrypt?text=
$ curl --request GET 'http://127.0.0.1:9000/app/play/encrypt?text=TEST_TEXT'
$ curl --request GET 'http://127.0.0.1:9000/app/play/decrypt?text=<ENCRYPTED _TEXT>'
$ curl --request GET 'http://127.0.0.1:9000/app/aes/encrypt?text=TEST_TEXT'
$ curl --request GET 'http://127.0.0.1:9000/app/aes/decrypt?text=<ENCRYPTED _TEXT>'
$ cd scalaplay2aesexample
$ sbt test
For production release:
$ sbt build --prod