Bitwise operations.
- Copyright:
-
- Crown Copyright 2016
- License:
-
- Apache-2.0
- Source:
Members
-
<static, constant> XOR_PRESERVE_NULLS
-
- Source:
-
<static, constant> XOR_DIFFERENTIAL
-
- Source:
-
<static, constant> KEY_FORMAT
-
- Default Value:
-
- ["Hex","Base64","UTF8","UTF16","UTF16LE","UTF16BE","Latin1"]
- Source:
-
<static, constant> XOR_BRUTE_KEY_LENGTH
-
- Default Value:
-
- ["1","2"]
- Source:
-
<static, constant> XOR_BRUTE_SAMPLE_LENGTH
-
- Default Value:
-
- 100
- Source:
-
<static, constant> XOR_BRUTE_SAMPLE_OFFSET
-
- Source:
-
<static, constant> XOR_BRUTE_PRINT_KEY
-
- Default Value:
-
- true
- Source:
-
<static, constant> XOR_BRUTE_OUTPUT_HEX
-
- Source:
Methods
-
<private, static> _bit_op(input, key, func, null_preserving, differential)
-
Runs bitwise operations across the input data.
Parameters:
Name Type Description input
byte_array key
byte_array func
function The bitwise calculation to carry out
null_preserving
boolean differential
boolean - Source:
Returns:
- Type
- byte_array
-
<static> run_xor(input, args)
-
XOR operation.
Parameters:
Name Type Description input
byte_array args
Array.<Object> - Source:
Returns:
- Type
- byte_array
-
<static> run_xor_brute(input, args)
-
XOR Brute Force operation.
Parameters:
Name Type Description input
byte_array args
Array.<Object> - Source:
Returns:
- Type
- string
-
<static> run_not(input, args)
-
NOT operation.
Parameters:
Name Type Description input
byte_array args
Array.<Object> - Source:
Returns:
- Type
- byte_array
-
<static> run_and(input, args)
-
AND operation.
Parameters:
Name Type Description input
byte_array args
Array.<Object> - Source:
Returns:
- Type
- byte_array
-
<static> run_or(input, args)
-
OR operation.
Parameters:
Name Type Description input
byte_array args
Array.<Object> - Source:
Returns:
- Type
- byte_array
-
<static> run_add(input, args)
-
ADD operation.
Parameters:
Name Type Description input
byte_array args
Array.<Object> - Source:
Returns:
- Type
- byte_array
-
<static> run_sub(input, args)
-
SUB operation.
Parameters:
Name Type Description input
byte_array args
Array.<Object> - Source:
Returns:
- Type
- byte_array
-
<private, static> _xor(operand, key)
-
XOR bitwise calculation.
Parameters:
Name Type Description operand
number key
number - Source:
Returns:
- Type
- number
-
<private, static> _not(operand)
-
NOT bitwise calculation.
Parameters:
Name Type Description operand
number - Source:
Returns:
- Type
- number
-
<private, static> _and(operand, key)
-
AND bitwise calculation.
Parameters:
Name Type Description operand
number key
number - Source:
Returns:
- Type
- number
-
<private, static> _or(operand, key)
-
OR bitwise calculation.
Parameters:
Name Type Description operand
number key
number - Source:
Returns:
- Type
- number
-
<private, static> _add(operand, key)
-
ADD bitwise calculation.
Parameters:
Name Type Description operand
number key
number - Source:
Returns:
- Type
- number
-
<private, static> _sub(operand, key)
-
SUB bitwise calculation.
Parameters:
Name Type Description operand
number key
number - Source:
Returns:
- Type
- number