1

Quoting myforwik's answer, CBC, OFB and CFB are identical, however OFB/CFB is better because you only need encryption and not decryption, which can save code space.

I want a pure implementation of AES CFB in PHP. I specifically do NOT want mcrypt.

I therefore turned to PHPSecLib. However, as per the documentation, the library only supports ECB and CBC.

I do not think myforwik meant that CBC and CFB can be used interchangeably... So, a) is there a CFB implementation out there, or b) can I (easily) implement CFB mode from PHPSecLib's CBC implementation?

Community
  • 1
  • 1
Félix Saparelli
  • 7,722
  • 5
  • 48
  • 67

2 Answers2

2

Check out the latest CVS of phpseclib. It supports CTR, CFB and OFB, in addition to CBC and ECB. I assume the documentation will be updated when a new version is released.

fruzer
  • 1,274
  • 3
  • 9
  • 4
1

CBC, OFB and CFB are not identical - though there are similarities. If they were identical, they would not have different names.

If you want AES + CFB, you cannot use AES + CBC to achieve the result. You will have to find a way to get AES + CFB implemented if it is not already available.

Jonathan Leffler
  • 666,971
  • 126
  • 813
  • 1,185