×
Namespaces

Variants
Actions
(Difference between revisions)

Como criptografar um texto usando QCryptographicHash, em Qt

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Automated change of category from Lang-PT to Unlikely Category. (Moving))
hamishwillee (Talk | contribs)
m (Text replace - "<code cpp>" to "<code cpp-qt>")
 
(6 intermediate revisions by one user not shown)
Line 1: Line 1:
[[Category:Lang-Portuguese]]
+
[[Category:Lang-Portuguese]][[Category:Qt]][[Category:Code Examples]][[Category:MeeGo Harmattan]][[Category:Symbian]]
[[Category:Qt]]
+
{{ArticleNeedsUpdate|language=Lang-Portuguese|timestamp=20120215095903|user=[[User:Hamishwillee|&lt;br /&gt;----]]|Example uses QCryptographicHash in a QWidget app framework. As QWidget is deprecated, should be updated to just show the use of the cryptographic hash. }}
[[Category:Code Examples]]
+
Original em: [[How to Encrypt a text using QCryptographicHash in Qt for Symbian]]
+
__NOTOC__
+
__NOEDITSECTION__
+
 
{{ArticleMetaData
 
{{ArticleMetaData
|id=...
 
|platform=S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
 
|devices= S60 Emulator
 
|category=Qt for S60
 
|subcategory=UI
 
|creationdate=10 April 2009
 
|keywords=QCryptographicHash,QByteArray
 
 
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= S60 Emulator
 
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|platform=S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
 
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
 
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
|author=[[User:Valderind4]]
+
|keywords=QCryptographicHash,QByteArray
 +
|language=Lang-Portuguese
 +
|translated-by=[[User:Valderind4]]
 +
|translated-from-title=How to calculate hash for a text using QCryptographicHash in Qt
 +
|translated-from-id=61730 <!-- automated guess -->
 +
|review-by=<!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate=20090922
 +
|author=[[User:Mind freak]]
 
}}
 
}}
  
 
== Introdução ==
 
== Introdução ==
  
A classe QCryptographicHash provê um modo de gerar ''hashes'' de criptografia, podendo ser usada para ''hashes'' de criptografia de binários ou de dados de textos.
+
A classe {{Qapiname|QCryptographicHash}} provê um modo de gerar ''hashes'' de criptografia, podendo ser usada para ''hashes'' de criptografia de binários ou de dados de textos.
  
 
Este criptografia é usada quando você deseja enviar alguma informação de um modo seguro. O texto criptografado é chamado de texto ''chiper''.
 
Este criptografia é usada quando você deseja enviar alguma informação de um modo seguro. O texto criptografado é chamado de texto ''chiper''.
Line 48: Line 49:
 
===Main.cpp===
 
===Main.cpp===
  
<code cpp>
+
<code cpp-qt>
  
 
#include <QtGui/QApplication>
 
#include <QtGui/QApplication>
Line 85: Line 86:
  
 
[[Image:Crypto.JPG]]
 
[[Image:Crypto.JPG]]
 +
<!-- Translation --> [[en:How to calculate hash for a text using QCryptographicHash in Qt]]

Latest revision as of 04:16, 11 October 2012

Needs-update.pngEste artigo precisa ser atualizado: Se você achou esse artigo útil, por favor corrija os problemas relatados abaixo e depois retire do artigo o modelo {{ArticleNeedsUpdate}}, para que este aviso seja removido.

Motivos: hamishwillee (15 Feb 2012)
Example uses QCryptographicHash in a QWidget app framework. As QWidget is deprecated, should be updated to just show the use of the cryptographic hash.

Article Metadata

Testado com
Aparelho(s): S60 Emulator

Compatibilidade
Plataforma(s): S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
Symbian

Artigo
Palavras-chave: QCryptographicHash,QByteArray
Tradução:
Por valderind4
Última alteração feita por hamishwillee em 11 Oct 2012

Contents

[edit] Introdução

A classe QCryptographicHash provê um modo de gerar hashes de criptografia, podendo ser usada para hashes de criptografia de binários ou de dados de textos.

Este criptografia é usada quando você deseja enviar alguma informação de um modo seguro. O texto criptografado é chamado de texto chiper.

[edit] Pré-requisitos

  • Baixe e instale a versão atual do Qt para Symbian segundo as instruções deste artigo.

[edit] Algumas funcionalidades relacionadas

  • Adiciona às informações hashes de criptografia.
QByteArray string="Nokia";
hash->addData(string);
  • Retorna o valor hash final.
QByteArray string1=hash->result();

[edit] Código fonte

[edit] Main.cpp

#include <QtGui/QApplication>
#include "textcodec.h"
#include<QWidget>
#include<QHBoxLayout>
#include <QCryptographicHash>
#include<QString>
#include<QByteArray>
#include<QLabel>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *win=new QWidget();
QHBoxLayout *lay=new QHBoxLayout();
QLabel *lbl=new QLabel();
QLabel *lbl1=new QLabel("Encrypted Text:");
lbl1->setBuddy(lbl);
QByteArray string="Nokia";
QCryptographicHash *hash=new QCryptographicHash(QCryptographicHash::Md4);
hash->addData(string);
QByteArray string1=hash->result();
lbl->setText(string1);
lay->addWidget(lbl1);
lay->addWidget(lbl);
win->setLayout(lay);
win->setStyleSheet("* { background-color:rgb(199,147,88); padding: 7px ; color:rgb(255,255,255)}");
win->showMaximized();
return a.exec();
}

[edit] Captura de tela

Leia mais: QCryptographicHash

Crypto.JPG

This page was last modified on 11 October 2012, at 04:16.
115 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×