And this is the problem I think many persons reported on the forum. Projeqtor uses PHP library for AES:CTR create by Chris Veness (
www.movable-type.co.uk/scripts/aes.html). This library uses it's own implementation of AES CTR and generate VI (key) base on password passed to function. Problem is this VI (key) is generated in a little complicated way.
I tried to connect C# to Projeqtor API and point was (probably like you and many others) how to encrypt data in C# using AES CTR. To do this you need to know VI key.
Take a look for projeqtor source code - you can find like like this:
$data=AesCtr::decrypt($dataEncoded, $user->apiKey, Parameter::getGlobalParameter('aesKeyLength'));
As you can see data you send to projeqtor via api are decrypted using function AesCtr:decrypt (from library I mentioned above) and as secret user_api_key is used. There is nowere passed VI key which we are looking for. Again this VI key is generated from user_api_key.
What is inside AesCtr:decrypt:
public static function encrypt($plaintext, $password, $nBits)
{
$blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
if (!($nBits == 128 || $nBits == 192 || $nBits == 256)) return ''; // standard allows 128/192/256 bit keys
// note PHP (5) gives us plaintext and password in UTF8 encoding!
// use AES itself to encrypt password to get cipher key (using plain password as source for
// key expansion) - gives us well encrypted key
$nBytes = $nBits / 8; // no bytes in key
$pwBytes = array();
for ($i = 0; $i < $nBytes; $i++) $pwBytes[$i] = ord(substr($password, $i, 1)) & 0xff;
$key = Aes::cipher($pwBytes, Aes::keyExpansion($pwBytes));
$key = array_merge($key, array_slice($key, 0, $nBytes - 16)); // expand key to 16/24/32 bytes long
....
So as you see generally user_api_key (used as secret) is expanded and itself again ecrypted by AES. A little complicated to implemenet outside projeqtor.
Unless my analysis is wrong, projeqtor should use something standard (standard for whole world not PHP only).