Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone help with Javascript based code (Cryptojs or Nodejs may be used) for developing the following CTR-based simple HMAC SHA-512 cipher:

SALT: Current epoch
CTR: SALT-0, SALT-1, SALT-2...
OTPi: HMAC-SHA-512 of password with SALT-i as data, where i is 0 for block 1, 1 for block2 etc.
OTP (One time Pad): OTP0|OTP1|OTP2|... till length of plain-text
Cipher-text: base64(epoch-(plain-text-XOR-OTP)). Here "-" after epoch acts as separater.

Sample:
plain-text: I believe simple HMAC-SHA512 can be used as very strong cipher. The data part of the HMAC shall be treated as salt in Counter mode. The output blocks shall be concatenated to produce a one time pad to be XORed with plain-text.

SALT: 1234567890
password: pwd
cipher-text: MTIzNDU2Nzg5MC3ifryoed1W5zDwwQS6CnrvmsYG1BHKainyzgiyTEiXWtITRV5sU9iOJT2CXKue
ZFIS/Hs8lzEGMnUuMH07G9iLg/hv0aYZeSXerziJxPl/OjeCxtIfJsSrsi5EeDEL1AdUOAaawdM+
jN7M6YF0M3V/vmTvRqZT7Md6cyugaAleK2ZPlKeqnUYKr8kAD5lvZnQlPbqViXSasLeLOpUCK6yk
c3SUsTbf1k6aw0xbDqRie60GCEfkN6HREvIAkbicyLi0M+1IKnIB+12HKZdE60f/5G5XrZLmVsBL
yT3X3aTsCOX3
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900