안녕 각 문자에 세 가지를 추가하여 파일을 암호화하는 윈도우 API를 코드를 작성해야합니다. 윈 API에서 파일을 암호화
그래서 나는 내가 어디로 ...이 지금은 일을하지 아무것도 쓴 wronge
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE filein,fileout;
filein=CreateFile
(L"d:\\test.txt",GENERIC_READ,0,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
fileout=CreateFile
(L"d:\\test.txt",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
DWORD really; //later this will be used to store how many bytes I succeed to read
do
{
BYTE x[1024]; //the buffer the thing Im using to read in
ReadFile(filein,x,1024,&really,NULL);
for(int i=0 ; i<really ; i++)
{
x[i]= (x[i]+3) % 256;
}
DWORD really2;
WriteFile(fileout,x,really,&really2,NULL);
}while(really==1024);
CloseHandle(filein);
CloseHandle(fileout);
return 0;
}
및 임 바로 내가 아는 방법의 확인
와우, 바보처럼 불리는 것보다 더 많은 도움을주는 것은 없습니다. –
@Steven Sudit : 바보 같은 이름이라도 그렇게 나쁘지 않습니다. – Tester101
@ 크리스티안 : 각 캐릭터에 3을 더하는 것이 실제로 암호화가 아니기 때문에 숙제인지 묻는 것입니다! winapi를 사용하는 코드를 작성하는 연습처럼 보입니다. 네가 기분을 상하게하지 않았 으면 좋겠다. –