beam

Basic Encryption Algorithm Module - BEAM. BEAM is a light weight Java library to encrypt and decrypt data. Created 2019 by Philip Heyse.

License

License

Categories

Categories

IDE Development Tools
GroupId

GroupId

de.bright-side.beam
ArtifactId

ArtifactId

beam
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

beam
Basic Encryption Algorithm Module - BEAM. BEAM is a light weight Java library to encrypt and decrypt data. Created 2019 by Philip Heyse.
Project URL

Project URL

https://github.com/pheyse/BEAM
Project Organization

Project Organization

Philip Heyse
Source Code Management

Source Code Management

https://github.com/pheyse/BEAM

Download beam

How to add to project

<!-- https://jarcasting.com/artifacts/de.bright-side.beam/beam/ -->
<dependency>
    <groupId>de.bright-side.beam</groupId>
    <artifactId>beam</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/de.bright-side.beam/beam/
implementation 'de.bright-side.beam:beam:1.0.1'
// https://jarcasting.com/artifacts/de.bright-side.beam/beam/
implementation ("de.bright-side.beam:beam:1.0.1")
'de.bright-side.beam:beam:jar:1.0.1'
<dependency org="de.bright-side.beam" name="beam" rev="1.0.1">
  <artifact name="beam" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.bright-side.beam', module='beam', version='1.0.1')
)
libraryDependencies += "de.bright-side.beam" % "beam" % "1.0.1"
[de.bright-side.beam/beam "1.0.1"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

BEAM (Basic Encryption Algorithm Module)

Created 2019 by Philip Heyse

Description

BEAM is a light weight Java library to encrypt and decrypt data. Security level of the encryption: "A government agency can break it. Your Mom can't." Unless your Mom works for a government agency or is a hacker ;-)

Approach

BEAM combines three mechanisms for encryption:

  1. From the provided password a longer password is generated
  2. Bytes are shifted depending on the value of the password bytes.
  3. Blocks are created and the position of the bytes in the block depends on the password bytes. Remaining bytes in the block are filled with random data.

License

Apace V2

Usage examples

Encrypt and decrypt strings

Beam beam = new Beam("myPassword");
String encryptedText = beam.encrypt("my text"); // creates a string such as 8087ED5FBB314E9F84B968AED20089...
String decryptedText = beam.decrypt(encryptedText); // produces "my text" again 

Encrypt and decrypt byte arrays

Beam beam = new Beam("myPassword");
byte[] myBytes = {(byte)10, (byte)11, (byte)12};
byte[] encryptedBytes =  beam.encrypt(myBytes);
byte[] decryptedBytes =  beam.decrypt(encryptedBytes);

Encrypt stream

Beam beam = new Beam("myPassword");
beam.encrypt(inputStreamWithPlainData, encryptedOutputStream, null);

Decrypt stream

Beam beam = new Beam("myPassword");
beam.decrypt(inputStreamWithEncryptedData, decryptedOutputStream, null);

Password as byte array

byte[] myPasswordBytes = {(byte)0, (byte)1, (byte)2, (byte)3, (byte)4, (byte)5, (byte)6, (byte)7};
Beam beam = new Beam(myPasswordBytes);

Password providing the block length

int blockLength = 64;
Beam beam = new Beam("myPassword", blockLength);

Including via Maven

[...]
		<dependency>
			<groupId>de.bright-side.beam</groupId>
			<artifactId>beam</artifactId>
			<version>1.0.1</version>
		</dependency>
[...]

Change History

Version 1.0.0 (2019-08-20)

  • first version

Version 1.0.1 (2019-09-12)

  • removed dependency with "javax.xml.bind.DatatypeConverter" which is included in the JDK/JRE but is missing on Android

Versions

Version
1.0.1