how to work with aes_decrypt on symfony 3

Asked

Viewed 55 times

-2

I have a database that is encrypted by another system and I need to decrypt the data for display in the system made in symfony 3.
I have the decryption key and need to do this. I have little experience in Symfony.
How should I do this? It would be in Entity or Controller?

  • @Ivanferrer, can you help me, please.

  • I believe neither and neither. You can do this as a service, model or filter. It depends on what you are doing. The function of the controller is only true / false to trigger methods. The function of Entity has more to do with the entity you are dealing with. If your method belongs to the entity, then it would be within it.

  • @Ivanferrer. I tried one like this but I have no idea how to do it. '/**
 * Get nomePaiDecrypt 
 * @param string $nome, $chave 
 * @return string 
 */ 
 public function getNomeDecrypt($chave, $nome) 
 { 
 $chave = 'MIICeQIBADANBgkqhkiG9w0BAQEFAASC'; 
 $nome = $this->nome; 
 return CRYPT_EXT_DES($nome, $chave); 
 }'

  • Look at the answer I posted.

  • Where? I don’t get it. About using Entity or controller? Sorry but I don’t have symfony experience. The function is correct?

  • In the other question.

  • Can you post the link? I can’t find.

  • Dude. Your other question is an SQL answer. What I need is how it looks in symfony. Gratefully.

  • are you using Doctrine, or dql? Gives a look here

  • Your question does not contain enough information for an answer to what you want. SQL is the answer to the question of how to use aes_decrypt, how to enter this, depends on how you are making use of the connection.

  • is using ORM?

  • Yes, @Ivanferrer. Symfony involves your resources.

  • Ok, it’s already the first step for someone to answer your question, but you’d better edit your question and add: 1. the controller method that will call this request; 2. your Entity class. 3. the type of query you intend to execute in your database.

Show 10 more comments

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.